Direct communications that can be delivered to a user’s mobile device are known as push notifications. These can show up on the top area of a mobile device or on the lock screen. Push notifications can only be sent by publishers if the user has their app loaded. Push notifications should have been enabled after installing the app because the app publisher may send them at any moment.
Cloud Messaging (FCM) technologies allow us to deliver messages to any device from Firebase. Allows to send and receive messages and notifications for free on iOS, Android, and the web by Firebase Cloud Messaging (FCM), which offers a dependable and power-efficient connection between your server and devices.
1. Create Project in Firebase
As a first step the user need a connector with firebase dependencies which has to be connected in mobile applications with firebase. Following are the process where the user should undergo while proceeding Firebase Project,
Step 1 : Create a new project in Firebase Console
Step 2: Enter project name (app name should be entered)
Step 3: Enable google analytics and continue the project
Step 4 :Select google analytics account
Step 5: Select android app under project overview
Step 6 : Enter the Package Name (Note: Must be as same as bundle Id in sterlo android) and register the android app
Step 7 : Download the android Configuration file (google-service.json)
Step 8 : Select iOS app under project overview
Step 9: Enter Package Name (Note: Must be as same as bundle Id in sterlo ios) and register the iOS app
Step 10 : Download the iOS Config file (info.plist)
Step 11 : Select web app under project overview
Step 12 : Enter the Application name
Step 13 : Register the web app
Step 14 : Generate new private key to get config file of web application follow the below steps
i. Select Project Settings
ii. Select Service Accounts
iii. Select Firebase Admin SDK -> Node.js -> click Generate New Private Key
Step 15 : Select configuration files under the SDK setup and Configuration tab
2. Connect Firebase with Mobile app in sterlo using Following steps
Step 1: Select Firease category and create connector with proper name
Step 2 : Enter the key values from the web app config
Step 3 : Upload the web private key file,android (google-service.json) and iOS(info.plist)
Step 4 : Select Debug and Release Environment
Step 5 : Select Test connection and save the connector
3. Send Notification to Mobile app from firebase for Common Users
We can send customized messages from firebase to all the users who have installed the mobile app. following the mentioned steps
Step 1 : Select Messaging option under the Engage category
Step 2 : Create the First campaign
Step 3 : Select Firebase Notification message and create campaign
Step 4 : Compose the notification with Title and Description
Step 5 : Select the Target Application which is the user installed in the Mobile
Step 6 : Scheduling the Notification and publishing the notification.
4. Device state Handling
- Depending on the device’s state, incoming messages are handled differently by the device and module.
- The user must have opened the app before messages can be received.
- Should ensure Foreground state of the device is close