[iOS] onMessageReceivedCallback not called when app is in background
See original GitHub issueI’m having an issue with onMessageReceivedCallback not called when app is in background or is reopened from background on iOS (tested on real device). In the callback function, I save the notification details so users can check back in the app. It works great when app is in foreground. I can receive the notifications when app is in background. If the app is reopened by clicking the notification, I can see the notification in the plugin output from console (attached below).
[320:22412] didReceiveNotification
But the details won’t be saved. I’m sure I already did what here says. ‘Background App Refresh’ is switched open on my device.
Some version info… iOS: 10.3.1 Xcode: 8.3.2
"dependencies": {
"nativescript-drop-down": "^1.5.3",
"nativescript-geolocation": "0.0.19",
"nativescript-orientation": "^1.6.1",
"nativescript-platform-css": "^1.4.0",
"nativescript-plugin-firebase": "^3.11.4",
"nativescript-sidedrawer": "^1.0.5",
"nativescript-sqlite": "^1.1.3",
"nativescript-telerik-ui": "^1.6.2",
"nativescript-theme-core": "~1.0.2",
"nativescript-zxing": "^1.5.2",
"tns-core-modules": "2.5.2",
"ts-promise": "^0.3.4"
},
"devDependencies": {
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"lazy": "1.0.11",
"nativescript-dev-android-snapshot": "^0.*.*",
"nativescript-dev-typescript": "~0.3.5",
"typescript": "~2.1.0"
}
Am I missing something? Or has anyone had same issue and found ways to work around of this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top GitHub Comments
Using correct silent notification message format resolved this issue.
@simba4everyoung Hey, what version of Firebase are you using? I am still struggling with this