Mobile Push 101

By pjain      Published July 9, 2019, 4:58 a.m. in blog Programming   

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.

  • Tutorial to add to your Android app - you add two services that extends FirebaseMessagingService and FirebaseInstanceIdService

  • 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.

Tutes

  • Google Tutes
  • Backend instructions for node.js for Android apps at this post on the Firebase Blog
  • https://firebase.google.com/docs/notifications/android/console-audience
  • IOS https://firebase.google.com/docs/notifications/ios/console-audience

  • Other Tutes

  • https://medium.com/@shaktisinh/android-push-notification-using-fcm-firebase-cloud-messaging-c37d165b8320
  • http://www.codewithasp.net/2016/11/notification-android-iso-web-fcm.html
  • http://developine.com/firebase-cloud-messaging-push-notification-android-tutorial/
  • http://developine.com/how-to-send-firebase-push-notifications-from-app-server-tutorial/
  • https://istudy.io/android-push-notifications-using-firebase-fcm/
  • https://maddeveloperweb.blogspot.com/2019/02/push-noification-with-firebase-in.html

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
  • https://count.ly/push-notifications/

IOS How to Implement- need to go through APNS


0 comments

There are no comments yet

Add new comment

Similar posts

Brilliant ways to use Physiotherapy app

Mobile: iPhone Market Structure

Smartwatches Review

Progressive Web Apps 101