'When to use iOS device token when sending push notifications through FCM?
I'm confused about the implementation of cloud messaging through FCM. To send an iOS device a remote (push) notification, an iOS device token is needed for APNs. However, a Firebase app doesn't interface with APNs, it interfaces with FCM, which interfaces with APNs. But to send a push notification (or message) to any client through FCM requires an FCM token. Does this mean that the iOS device token is not needed for a Firebase app to send push notifications to iOS devices?
Solution 1:[1]
Only an FCM token is required to send a message to a device. There is no Apple-specific data required. Firebase handles the details of each underlying push notification system.
Solution 2:[2]
Firebase uses method swizzling to automatically map your FCM token to your APNs token, as explained in the Firebase Docs here (or see images below).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Doug Stevenson |
| Solution 2 | Eric |


