There is a problem that I am using OneSignal for push notification in my app, I want onesignal's NotificationExtenderService
should start when user closes the app and stop when user opens app
in other words,disable service when app is launched and enable when app is closed,
Please Help!
Since you tagged with Firebase, I assume that Firebase Cloud Messaging (FCM) is involved. FCM has two message types:
Notification messages are handed by the system when you app isn't active, and delivered to your code when the app is active. This means that in its default behavior (ie if you only add the SDK and no custom code to the app) shuld be precisely what you describe:
Data messages are always deliver to the code in your app. This means that you code can determine whether to display a notification or not.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.