'FirebaseMessaging.onBackgroundMessage in iOS when app is terminated/in-background never called
I have this issue, that I have a handler passed to FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler) that's responsible to save the incoming notification record into SQFLite database and to show the incoming notification with a Big Image by calling:
flutterLocalNotificationsPlugin.show()
However, when running the app in iOS and when app is in background or terminated, then the notification appears as expected, but the onBackgroundMessage doesn't get called, I know it's not being called because the notification related record is not being saved into SQFLite database nor the Big Image appear in the notification, but the title and body of the notification are displayed correctly, Please advise, Note: The payload I'm sending with Firebase Cloud Messaging is as follows:
{
"to": "My-Device-Token",
"notification": {
"Type": "Price_Inquiry",
"title": "Price Inquiry Reply",
"body": "Item #R45 Price",
"Image": "URL_To_Big_Image",
"ID": 1960,
"Recipient": "Recipient Name"
},
"data": {
"title": "Price Inquiry Reply",
"body": "Item #R45 Price",
"image": "URL_To_Big_Image",
"email": "[email protected]",
"type": "Price_Inquiry",
"id": 1960
}
}
Your help is highly appreciated, Thanks in advance,
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|