Skip to content

Notification not showing if app not running #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jax297 opened this issue Feb 27, 2018 · 7 comments
Open

Notification not showing if app not running #86

jax297 opened this issue Feb 27, 2018 · 7 comments

Comments

@jax297
Copy link

jax297 commented Feb 27, 2018

Hey, is there a way to show the notification even if app is not running?

@vietdungdev
Copy link

vietdungdev commented Feb 28, 2018

did you mean Hide notification while unity activity is visible

public boolean isForeground(){

        Activity currentActivity = UnityPlayer.currentActivity;
        // If not then our app is not on the foreground.
        return currentActivity != null && currentActivity.hasWindowFocus();
    }

and

   public void onReceive(Context context, Intent intent)
    {
        Boolean notifyOnForeground = intent.getBooleanExtra("notifyOnForeground",true);
        if(notifyOnForeground == false && isForeground()) return;
     //other code
   }

@jax297
Copy link
Author

jax297 commented Feb 28, 2018

@DungDajHjep Sory, no, what I meant was:

  • open test application
  • click 5seconds and close it before the notification fires (so close it immediately after clicking)
  • result: notification does not show
    -- expected result: notification shows even if app is not running
  • Additional info: this happens on Android 5.1. Android 7.0 works fine

@Agasper
Copy link
Owner

Agasper commented May 21, 2018

Can't reproduce. Please provide ADB logs and reopen issue if it appears after update

@Agasper Agasper closed this as completed May 21, 2018
@lhs77074232
Copy link

@Agasper

  1. open test application
  2. modify function OneTime In NotificationTest.cs ->
    LocalNotification.SendNotification( 1, 50000, "Title", "Long message text", new Color32( 0xff, 0x44, 0x44, 255 ) );
  3. click onetime 5 sec button
    4.close app

it will apper

@lhs77074232
Copy link

test.log
@Agasper this is the log

@Agasper Agasper reopened this Dec 14, 2018
@iRDS
Copy link

iRDS commented Jun 26, 2019

Any news on this? I'm having the same issue on Android Oreo 8.0 if you make the app go to background the notifications works just fine, but if you force close the app, the notifications wont be shown

@littlelittlefox
Copy link

Any ideas? I have the same problem now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants