push notifications not received by everyone

橙三吉。 提交于 2019-12-23 04:47:40

问题


I am using GCM service to send push notification to all the users. But the problem I came across as soon as I updated the app from 1.3 to 1.4 is that our Notifications are not reaching the users that updated the app but are only reaching the users that installed the app for the first time.

https://medium.com/@murki/gcm-push-notifications-registration-done-right-7aba759d1d55

Going by the above article I confirmed that we need to re register the GCM as soon as the app is updated. So following the tutorial I wrote a SERVICE that re registers the device again.

I tried out a demo project on GCM and understood that the GCM id for the device would remain the same no matter how many times I register. But still for my APP I re registered the GCM on update. Now the problem is that My notifications are going out to only a few of them and the rest of them are unable to receive the notifications.

List of problems : 1) I dont know which among the many users received the notification and which not. So is there a way we can identify the users which received the notifications.

2) How do I send the notifications to the rest of the users.

3)What is the permanent solution to the problem which will ensure us that the notifications reach all the users.


回答1:


Ya i solved the problem It was not the GCM issue, it was an error from my side. Once the GCM is received I have to hit my own server to get the details of the new notifications. The URL that was supposed to be hit contained the USER ID and i stored the user id in static variable which are not accessible when the app is not running SO the USER ID in the URL was replaced by null. So i never got the details of the notification.



来源:https://stackoverflow.com/questions/30300157/push-notifications-not-received-by-everyone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!