Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect uninstall event in phonegap app

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.

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

Note: I am using PushPlugin

like image 326
ahsanali Avatar asked Mar 28 '15 13:03

ahsanali


1 Answers

AFAIK, you cannot know when your app is uninstalled.

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

For iOS : read this Question and its answer on SO

like image 113
Ajoy Avatar answered Nov 16 '22 10:11

Ajoy