Mobile Push 101
Android Notifications and Push
Android - Internal to Phone Notifications
Android Server Side Push Notifications how to through FCM
Firebase is a cross-platform messaging solution that lets you send the unlimited number of push notifications at no cost. To send the messages it will use the service called “Cloud Messaging” which allows sending messages using Http requests. The FCM public API sets up a notification, needing your FCM registration info, device registration ID, and a referencing token or topic of your choice to send notification to target users. Firebase will collect and store all the user data who are subscribed to you and acts as a medium to send timely Push messages to your subscribers.
App Install => send device registration ID => Your BE Server Dashboard and Push Platform - setup at eg your own/setup at 3rd party) -a. manual web based UI to initiate a static push - select one user, multiple user/group, all users. - b. or custom program logic Your BE Notification Server ==> FCM >> Send messages to Web/Tablets/Mobile Devices
Advantage over WebPush is that FCM will send messages to the users even if the user is not on the website which he subscribed to.
If you need to send a broadcast push notification too all users of your app, you need to store user device IDs and manage their push notification subscriptions somewhere in your database.
You need to use Firebase Cloud Messaging to send messages to devices.
SETUP. You need to create an account in Firebase and create your project in it. You will find all the things about your project in the Firebase Console.
You must have an accompanying app - native or wrapped. You cannot just send a message to an Android phone without an app.
After setting up the Firebase you need to request the user's permission to send the notifications. Hence after allowing you to send the Push messages by the user, you can able to send Push notifications to them.
When a user installs your app, send the Registration/Device Id to your Backend i.e. Django app (e.g. http://mysite.com/urlroute/save_id/)
From within your Backend app to SEND a message, ie to push a notification to the Android device associated with the Id. 5a. You need to request the Firebase API through the server key, Informing that the user will receive Push messages and hence you can send notifications to your users. 5b. To send notifications to multiple users you need to insert the details of the multiple users by using the feature “Topic” and you can send them the notifications with a single request. 5c. do a POST to https://android.googleapis.com/gcm/send along with other parameters.
- Google Tutes
- Backend instructions for node.js for Android apps at this post on the Firebase Blog
Scheduling Manual using Push Dashboard
Dashboard and Push Platform - setup at eg your own/setup at 3rd party) -a. manual web based UI to initiate a static push - select one user, multiple user/group, all users. - b. or custom program logic - from your own BE server
- You can install your own push notification server on a single Linux box using Countly - see screenshot -http://github.com/countly/countly-server