No background notifications on IOS // Version 5.0.2
See original GitHub issueHi,
so far everything works fine but I don’t get background notifications on ios. If I start the app - the notifications are delivered and shown with the local notifications plugin. Remote Notifications are activated in the apropriate Xcode Project (and “UIBackgroundModes” in Info.plist , too).
In main.ts (before bootstrap) I have the following code. My expectation is that the local notification is shown even if the app is in the background. What I am missing? Any help would be appreciated!!!
firebase.init({ // Optionally pass in properties for database, authentication and cloud messaging, // see their respective docs and 'iOSEmulatorFlush' to flush token before init. iOSEmulatorFlush: true, onPushTokenReceivedCallback: function(token) { console.log("Firebase push token: " + token); }, onMessageReceivedCallback: function(message) { console.log("scheduling test notification.."); LocalNotifications.schedule([{ id: 1, title: 'New Local Test Title', body: 'New Local Test message', ticker: 'The ticker', badge: 5, groupedMessages:["The first", "Second", "Keep going", "one more..", "OK Stop"], //android only groupSummary:"Summary of the grouped messages above", //android only ongoing: true, // makes the notification ongoing (Android only) smallIcon: 'res://heart', sound: "customsound-ios.wav", // falls back to the default sound on Android at: new Date(new Date().getTime() + (1 * 1000)) // 10 seconds from now }]).then( function() { console.log("Notification scheduled"); }, function(error) { console.log("scheduling error: " + error); } ); } }).then( (instance) => { console.log("firebase.init done"); }, (error) => { console.log("firebase.init error: " + error); } );
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:54 (15 by maintainers)
Top GitHub Comments
After I add
"click_action":"FCM_PLUGIN_ACTIVITY"
into the payload and the functiononMessageReceivedCallback
now can be triggered after user click the notification message.@indianazhao i had same exact the same issue before it did re-create all my apple certifications. are you sure that all certifications is valid and correctly installed?
Check out https://www.youtube.com/watch?v=LBw5tuTvKd4 how do fix the certifications, you can skip the swift parts in the video.
Eddy fixed:
in the app.component.ts