删除后重新安装清新的iOS推送通知 [英] remove iOS push notification after fresh reinstall

查看:205
本文介绍了删除后重新安装清新的iOS推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有应用程序,它成功地将苹果推送通知,当与推送通知的应用程序的应用注册用户登录和令牌保存在我们的后端,当用户从应用程序注销,我们删除了推送通知从我们的后端令牌。但如果从设备,而无需从应用程序注销用户卸载应用程序,然后重新安装,在这种情况下,我们仍然可以发送推送通知到设备,因为应用程序是新安装的,并没有登录的任何用户,我们必须删除令牌从后端。因为iOS应用程序不具有卸载事件我怎么才能把后端设备令牌的API。我可以使用推送通知反馈服务来获得卸载设备令牌,但我怎么能解决这个问题,当用户删除应用程序,然后重新安装。

I have application which has successfully integrated apple push notifications, when user logs in to the application app registers with the push notification and token is saved on our back-end, when user sign out from the app, we remove the push notification tokens from our back-end. but if user uninstall app from the device WITHOUT SIGN-OUT from app, and then re-install,in that case we can still send push notifications to the device, since app is newly installed and not logged in any user we have to remove tokens from the backend. since iOS app does not have any API for uninstallation events how can I remove device token from back-end. I can use push notification feedback service to get uninstalled device tokens but how can I resolve the issue when user removes the application and then reinstall.

我测试了此方案与Skype,它也有这个问题。 (安装的Skype>登录>(现在你可以发送应用背景与任何其他设备发送一些聊天记录,你会得到推送通知)>然后从设备上删除应用,而无需通过Skype注销>重新安装的Skype>现在如果我们发送的Skype聊天,我们收到推送通知,但Skype的应用程序是新安装的,没有人是登录)

I tested this scenario with skype, it also have this issue. (install Skype > Log In > (now you can send app to Background and send some chats from any other device, you will get push notifications) > then Remove app from Device without Sign-Out from Skype > Re-Install Skype > now if we send skype chat we receives push notifications but skype app is newly installed and no one is logged in)

推荐答案

我猜你能做的最好的事情是preventively注销/删除标记,当应用程序在没有登录的用户启动。你应该每个应用程序启动时更新反正登记,所以在每个应用程序启动注册/注销,这取决于如果用户或没有登录。这样一来,如果用户重新安装应用程序,并开始它的第一次,这将是未注册的。

I guess the best thing you can do is to preventively unregister/remove the tokens, when the app is started without a logged in user. You should update the registration anyways each time the app is started, so register/unregister at each app start, depending on if a user is logged in or not. This way, if the user reinstalls the app and starts it the first time, it will be unregistered.

这是可以达到的最好的行为,因为这是推特,脸谱,Skype公司,等等...

This is the best behaviour you can achieve, as it is the same for Twitter, Facebook, Skype, etc...

这篇关于删除后重新安装清新的iOS推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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