Dismissed push notification resumes app


#1

I added firebase cloud messaging to an android app, and I have run into an issue I can’t resolve. This issue also happens with the juce push notification tutorial app as well.

If the app is in the background, and I dismiss the notification in the notification tray, the app gets resumed (or launched if it’s not running).

I get the localNotificationDismissedByUser callback before onResume is called.

I don’t want the app to resume or start if I dismiss a notification. How can I prevent this?


#2

It dawned on me that setupNotificationDeletedCallback() in juce/juce_gui_extra/native/juce_android_PushNotifications.cpp sets an explicit callback for when a notification is dismissed (in case you want to handle that), but I just want to completely ignore it, so I just commented out the call to setupNotificationDeletedCallback() and no more starting/resuming the app when a notification is dismissed. Problem solved.