Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Firebase Push Notification Setup
To setup Firebase Cloud Messaging you first need to follow:
- Setup an APN key.
- Inside your project in the Firebase console, select the gear icon, select Project Settings, and then select the Cloud Messaging tab.
- In APNs authentication key under iOS app configuration, click the Upload button.
- Browse to the location where you saved your key, select it, and click Open. Add the Key ID (available in Certificates, Identifiers & Profiles in the Apple Developer Member Center) and click upload.
- Enable the push notifications capability in your Xcode project Project -> Capabilities -> Push Notifications
- Add the Server key from the Firebase console Settings -> Cloud Messaging -> Project credentials to the
cloud_messaging_server_keyentry in Info.plist -> chat_sdk -> firebase
Note: We add the server key directly to the project because it makes it very easy to send targeted push notifications. However, this method isn't the best from a security perspective because it means that if someone decompiled and examined the app package, they could gain access to the key and send push notifications using your account. A more secure approach would be to use a separate app server to send the pushes or to use Google Cloud Code.