推送通知状态检查Android [英] Push Notifications status check Android

查看:141
本文介绍了推送通知状态检查Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户可以在应用程序的更高版本的Android中禁用推送通知,应用程序是否可以知道用户在设置中禁用推送通知?

解决方案

请看这里: http://developer.android .com / google / gcm / adv.html#unreg

有一种解释方式。


另一种方法可能是:<
如果您已经实现了GCM服务器,那么您的应用程序会向服务器发送一条消息,表明它不再需要任何更新。

此后,服务器从其设备数据库中删除该REGID。

从现在起,您的设备不应该收到任何推送消息。



您也可以尝试做出客户端决定并过滤消息用户不需要任何推送消息(这样他们仍然会在服务器端发送)。所以我会实现一个服务器端解决方案。似乎是最干净的方式。


User can disable push notifications in later versions of android for an application, is there any way application can know that push notifications are disabled by user in settings ?

解决方案

Look here: http://developer.android.com/google/gcm/adv.html#unreg
There one way is explained.

Another way could be:
If you have implemented a GCM server then your app sends a message to the server that it does not want any updates anymore.
After that the server deletes the regId from its devices database.
From now on your device should not get any Push Messages.

You could also try to make a client side decision and filter the messages if the user does not want any push messages (that way they would still be sent on the server side)

So I would implement a server side solution. Seems to be the cleanest way for me.

这篇关于推送通知状态检查Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆