push notification - Android Gcm Unregister Users Subscribed To A Topic When App Uninstalled -


scenario: have 3rd-party app server, gcm http connection server, , android app setup push notifications. when user uninstalls app, can delete them 3rd-party server sending (no-longer-valid) registration id push notification , handling "notregistered" error returned gcm connection server.

however, similar approach not seem work when send push notification users subscribed "topic", here gcm connection server returns json object "message_id".

the notable columns in 3rd-party server database table follows:

| gcmregistrationid (string) | subscribedtonotificationtopic (boolean) | 

does know how identify user has set true in subscribedtonotificationtopic column, uninstalled app?

i have idea on how resolve this, seems messy.

  1. every often, instead of sending push notifications topic e.g.

    {     "to" : "/topics/global",     ... } 

    send push notification registration ids of users subscribed topic e.g.

    {     "registration_ids" : {list of registration ids},     ... } 

    such can retrieve , handle "notregistered" errors.

the problem however, multicast messaging has limit of 1000 users i'd have send message each thousand.

this seems bad practice (especially if there more 1 topic involved), maybe it's way?

(extra tags: topic messaging, pubsub, unregister, google cloud messaging)

first off, not sure correct assume "notregistered" error can result of user uninstalling app. seems device can become unregistered if device receives message message can not delivered. can happen if user stops app (which different uninstalling it, or if app killed , remains stopped due power saving mode.

https://developers.google.com/cloud-messaging/ccs#response

if notregistered, should remove registration id server database because application uninstalled device, or client app isn't configured receive messages.

what can device side, periodically register device, , make sure token same 1 stored, if not update server new token.

as far detecting if user has uninstalled app via response topic message, agree not seem directly possible. alternative proposed solution, might, every , include flag in topic message ask device validate server, if device not validate after number of attempts or period of time might conclude user not longer listening.

the other question why need know. there harm in sending regid's google? if user quits web service can remove them list, need take action if un-install app there device? - thing consider. hope helps.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -