lurning too koad
lurning too koad

Reputation: 2974

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?

Upvotes: 5

Views: 2348

Answers (2)

Eric
Eric

Reputation: 769

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).

enter image description here

enter image description here

Upvotes: 1

Doug Stevenson
Doug Stevenson

Reputation: 317828

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.

Upvotes: 4

Related Questions