检测PhoneGap的应用程序卸载事件 [英] Detect uninstall event in phonegap app

查看:189
本文介绍了检测PhoneGap的应用程序卸载事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户安装我的应用我注册了注册ID(Android)或设备令牌(IOS)和发送做工精细推送通知。但现在我想删除时,应用程序卸载服务器的用户。

When a user installs my app I register his registration ID (android) or device token (iOS) and send push notifications that work fine. But now I want to remove the user from the server when the app is uninstalled.

如何在PhoneGap的做到这一点:得到一个事件发生后,我可以注销用户注册ID(Android)或设备令牌(IOS)

How can I accomplish this in Phonegap: get an event after which i can unregister the user registration id (android) or device token (ios)?

请注意:我使用的 PushPlugin

推荐答案

据我所知,你可以不知道什么时候你的应用程序将被卸载。

AFAIK, you cannot know when your app is uninstalled.

有关您的机器人应用,观察其反应GCM的回报,当你发送通知。如果发送 NotRegistered 消息,可以从服务器上删除该id。阅读注销是如何工作的

For your android app, observe the response GCM returns when you send a notification. If it sends a NotRegistered message, you can remove that id from your server. Read how unregistration works

对于 iOS版:阅读<一href=\"http://stackoverflow.com/questions/21592576/how-to-detect-user-uninstalled-ios-app-i-need-push-serious-notification-i-don\">Question及其对SO答案

For iOS : read this Question and its answer on SO

这篇关于检测PhoneGap的应用程序卸载事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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