I've setup Firebase Cloud Messaging on our system to setup push notifications. Before our APNs certificate expired and we ran into some issues because of this.
Then I was able to generate an APNs Authentication Key and I assumed that this one couldn't expire. Can someone tell me if that assumption is correct?
No. APNs Auth Key will never expire as Apple suggests. It is now a more preferred way to handle Push Notifications than using APNs Certificate.
Related
What information is used by APNS to generate device tokens and identify that it's unique to the device and app?
I have gone through apple documentation but it only tells that the token is unique to device and app , but how the token gets generated the process is not diclosed.
It's an opaque token. By design, you're not going to be able to reverse engineer how APNS tokens are generated and make your own.
If it helps, you might think of an APNS token as a hash of a bunch of things, some of which you can't see or control.
First, sorry for my English.
I'm trying to send a message to my iOS device using Firebase Cloud Messaging.
However, there are several tokens with different names.
What do these tokens do? What is the difference?
Is FCM token the same as registration token and APNs token the same as device token?
And how can FCM token be made with APNs token?
There are two definitives here:
APNS Token is the Apple Push Notification Service token. It is a token (think of it like a password) that authenticates your app and device onto the Apple Push service and allows for communications to be sent.
FCM Token is the Firebase Cloud Messaging token. This is googles version of the APNS Token however works for both iOS and Android (Google do proxying on their end when sending a push notification to iOS devices).
When you refer to a registration token or a device token it really does depend on the context you use the phrases. They are often used interchangeably and neither are really "official" terms. For the most part, both terms refer to your APNS/FCM token, however device token has historically been used for other things like unique device identifiers.
I have an app in production that's heavily dependent on push notifications, and I'm worrying that revoking the old .p8 key will invalidate the existing FCM tokens. Unfortunately I can't get the old .p8 key from previous developer, so revoking is the only option. I couldn't find the answer in Firebase documentation. Any ideas?
I'm planning to migrate the APNs to the Authentication tokens system from the old (certificate based), but I don't want to invalidate the existing valid tokens. Does anybody have any experience with this? Will the existing token still works after migration?
TIA
Token is device specific and if you create an Auth token (which is new way of using push notifications as they have no expiry date), It would have no effect on device token. I guess the proper question here would have been whether the notifications using the old APNS certificates would still be working or not(considering it has been set up on the server as well) even in that case the answer would be Yes. As long as you do not revoke the certificates it would still be working
The token is generated on the device that will receive the notification and is based on your bundle ID and the device. It is not dependent on the credentials that your server uses to connect to the APNS service (The iOS device has no information on this).
As a result you can change the way you connect and authenticate without any impact to existing tokens. It is no different to using a new certificate when the old one expired with the old system.
I've recently learned of the new APNS Authentication Key mechanism which is set to replace the functionality of the existing system of APNS certificates.
From my understanding this key supersedes all existing certificates, and can authenticate requests for all my apps.
I am confused about the transition though. Does this key only work for apps that are newly built/provisioned/released? My Firebase console invites me to upload my new APNS Authentication Key, but upon doing so, warns that my existing certificates which are being used in production will be removed. Does this mean my existing users will stop receiving push notifications?
IMHO, transitioning from certificate-based to authentication token-based only affects how your application server communicates with the APNS provider, thus existing users of your application will not be affected.