Firebase onMessageReceived never called when app is not running and removed from recent apps list. I'm working with Firebase and sending data payload notifications to my app from my server, i have tried to use JobScheduler to start MyFirebaseMessagingService every 1 minute in case the system is killing my service but this approach didn't work for me on One Plus 3. I know that android add limitation on background services to optimize battery usage, but does this limitation affect on FCM service?
here is my message string:
{
"notification": {
"title": "Hello",
"body": "Notification",
"badge": 1,
"icon": "app_icon",
"color": "#ffffff",
"sound": "default",
"clickAction": "home",
"tag": "parent_ccid_6"
},
"message": {
"priority": "high",
"type": "daily_tips",
"data": {
"parent_ccid": "parent_ccid_6",
"id": "2",
"sound": "default"
}
},
}
and here is my Service in manifest
<service
android:name=".util.FCM.MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>