Open jax297 opened 6 years ago
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
}
@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
Can't reproduce. Please provide ADB logs and reopen issue if it appears after update
@Agasper
it will apper
test.log @Agasper this is the log
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
Any ideas? I have the same problem now
Hey, is there a way to show the notification even if app is not running?