1

I need to work on android mobile push notification. I have recently gone through some of the tutorial on google. I would like to summarize the my understanding first

  1. Developer registers the app with play store and get some unique code called Application_Id
  2. Once the end user downloads the application from store and login(or register) the application, his/her device_id is sent to to GCM(google cloud messaging service(hosted on google cloud) and GCM generate the unique token for that device and sent back to app on device.
  3. App on device send back that token to back end app server which keep the device_token_gcm along with user details
  4. Now whenever back end need to send the notification to mobile user, first it will send to GCM along with device_token_gcm which GCM will forwards to mobile user.

Is that correct ?

Question :-

  1. What if user is offline, will GCM keep it with itself somewhere in queue ?
  2. I believe GCM keeps the device_id with itself and generate the unique token which is sent to back end app server. So back end application has unique token not device_id ?
  • I think this is one of those things which would be answered more efficiently by simply performing a test. – Neil Oct 16 '18 at 6:46
1

I am going to assume you mean FCM, considering GCM has been deprecated.

What if user is offline, will GCM keep it with itself somewhere in queue ?

Yes, even when the device is offline at the time of invoking the notification from your server, it will be dispatched to FCM service and FCM will try to notify the device once it comes online. The default TTL of an FCM message is 4 weeks, i.e. if your device fails to come online within 4 weeks, the message is discarded.

You can also specify your own TTL settings, in which case the expiration might be shorter.

I believe GCM keeps the device_id with itself and generate the unique token which is sent to back end app server. So back end application has unique token not device_id ?

Yes, your backend knows nothing about the actual notification token, it has a device token generated by the FCM service which it uses to call FCM's API to invoke a push notification.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.