Nanfeng

Notes on software development, code, and curious ideas

Integrating FCM Push Notifications on iOS

Prerequisites

  1. An Apple Developer account. This is required even for testing.
  2. An App ID with Push Notifications enabled.

Setup

  1. Open the Firebase console and create an iOS app. Unlike Android setup, you must first create the app in the Apple Developer portal and enter its bundle ID in Firebase.
  2. Open the section shown below and upload the corresponding APNs authentication key, which is the recommended option.

Upload the APNs key in Firebase

You can also upload an APNs certificate—the .p12 certificate commonly used for push notifications. The authentication key described above is a .p8 file.

Create an APNs authentication key (.p8)

Open Certificates, Identifiers & Profiles in the Apple Developer portal and create an APNs key:

Create an APNs key

Enter a name and description, then enable Apple Push Notifications service (APNs):

Enable APNs

Continue, click Save, and download the key:

Save the key

Download the key

Pay attention to the warning in yellow: the key can be downloaded only once, so store it securely. Finally, return to Firebase and enter the requested APNs key information.

+