question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS push notifications failing after several days

See original GitHub issue

I’m facing an issue where a new iOS user will initially be able to receive FCM push notifications, but after a few days, stops being able to receive them. However, the server which is sending the push notifications still receives a success message from FCM:

{ multicast_id: 5364950433438816000, 
  success: 1, 
  failure: 0, 
  canonical_ids: 0, 
  results: [ { message_id: '0:1471123826177313%13c7f1c613c7f1c6' } ] } 

After I tried manually sending a notification to the relevant FCM token through the firebase console (which failed), the server then starts getting a failed message from FCM:

{ multicast_id: 4711697033517732000, 
  success: 0, 
  failure: 1, 
  canonical_ids: 0, 
  results: [ { error: 'NotRegistered' } ] } 

This led me to believe that the FCM token my server had was somehow out of date; however, I double checked, and the FCM token my server is using is consistent with the token given by calling FCM.on('refreshToken', (token) => ... in the app.

Is there some other reason why this might be occurring?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
evollucommented, Aug 15, 2016

do you get refreshToken called all the time?

0reactions
wsuncommented, Nov 18, 2017

In case this is helpful for others - I experienced a similar issue, where the FCM token had not changed, but at some point the user was no longer able to receive remote push notifications. This was because we failed to regularly keep the APNs device token up to date: we did not call registerForRemoteNotifications appropriately on every app launch (i.e. in AppDelegate), as Apple requires. This method then triggers the Firebase-swizzled didRegisterForRemoteNotificationsWithDeviceToken to map the new APNs device token to the current FCM token.

This issue only seemed to occur on devices where we were regularly installing new app builds, so I suspect the APNs device token changes under certain circumstances, even when the FCM token is still the same.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Push notifications stopped being d… | Apple Developer Forums
We have an issue with push notifications that we have been trying to solve for a month now - unsuccessfully. The problem is...
Read more >
5 ways to fix iPhone notifications when you're not receiving them
1. Open the Settings app. · 2. Tap Notifications. · 3. Tap on Show Previews at the top. · 4. Tap Always so...
Read more >
iPhone Notifications Not Working? Here's The Real Fix!
An Apple expert explains why iPhone notifications are not working and shows you how to fix the problem with a simple, step-by-step guide....
Read more >
8 Quick Fixes for Notifications Not Working on iPhone - Dr.Fone
1. Simply restart your iPhone 2. Check if your iPhone is in Silent Mode 3. To update your iPhone to latest iOS, Go...
Read more >
Top 8 Tips to Fix iPhone Notifications Not Working on iOS 16/15
Fix iPhone Notifications Not Working after iOS 16/15 Update · Tip 1. Check the Ring/Silent Button · Tip 2. Disable Do Not Disturb...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found