Is the registration token updated when the application starts in iOS?

When I install the application for the first time and asks for permission to receive a notification, if I click "yes", then the device token appears, but whenever I restart the application, I get an error message:

Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "(null) 

Can someone determine if a device token is generated every time the application starts?

+5
source share
2 answers

Nope. A (new) token is not generated every time the application starts. It is generated upon initial launch (i.e., the first launch after installing the application). From docs :

By default, the FCM SDK generates a registration token for a client application instance the first time you launch your application.

But this may change due to the following scenarios (also from documents):

The registration token may change if:

  • Application removes instance id
  • The application is restored on the new device
  • User uninstalls / reinstalls the application
  • The user deletes the application data.
+3
source

Today, the document says https://firebase.google.com/docs/cloud-messaging/ios/client#access_the_registration_token

The application is restored on the new device

User uninstalls / reinstalls the application

The user deletes the application data.

It seems that the FCM token is not generated when we remove the instance id.

0
source

Source: https://habr.com/ru/post/1263773/


All Articles