Firebase Push Notifications (FCM)
Push Notifications is a useful Flutter plugin. With this plugin, your Flutter app can receive and process push notifications on Android and iOS.
This guide shows you the way to setup Firebase Cloud Messaging(FCM) to push notifications.
Remember to disable OneSignal if you push notifications using Firebase, following this guide https://docs.shopbuilder.app/Features/onesignal/
1. Push Notifications in iOS
Precondition: refer to "1. iOS" in https://docs.shopbuilder.app/Features/firebase-settings/ to create an IOS application on Firebase
Step 1: Install Cloud Messaging to enable push notifications on iOS. Click Cloud Messaging as shown:
- Installing Cloud Messaging requires you to upload the auth key APNs here
- To get this key, you must have an apple developer account. Visit page https://developer.apple.com select
Account
as shown:
Then choose
Certificates, identifiers & Profiles
Select Keys on the left menu, then click the plus icon to add a new key:
Note: 1 developer apple account can only create 2 keys, please consider before creating. But you can still delete them if needed.
- Enter the key name and select Apple Push Notification service (APNs) then click
continue
- Click
Register
- Click
Download
to download the APNs key file
- Return to the firebase console to update the APNs auth key. Click
Upload
- Click the Browse button then select the downloaded key:
- The key ID is the back part of the downloaded key file name:
- Enter Team ID, if you do not know where Team ID is coming from, please click on the question mark as shown in the picture, then click on the
membership tab
This is Team ID, copy it and enter the form in firebase:
- Click
Upload
:
In some cases, this error will be displayed (in some cases it will not be). If this is the case, please click Upload
again:
If the following screen appears, congratulations, you have successfully configured:
Step 2: Get Server Key
Go to the following path Cloud Messaging
and select your Firebase Console project to get Server Key
Input your Server Key:
Then send a message to push notification.
Note:
- The Server Key taken must be the Server Key of that project.
- Absolutely do not share Server Key.
2. Push Notifications on Android
Precondition: refer to "2. Android" in https://docs.shopbuilder.app/Features/firebase-settings/ to create an Android application on Firebase.
Steps:Go to the following path Cloud Messaging
and select your Firebase Console project to get Server Key
Input your Server Key:
Then send a message to push notification.
Note:
- The Server Key taken must be the Server Key of that project.
- Absolutely do not share Server Key.