Ionic Push unregister on delete (own push-server)


#1

I have installed the Push plugin within my app. I am able to send a deviceID to my server on which I can connect the deviceID to the userID. That way I can send personalised push messages to all devices this user has logged on. I have created my own “push server” which handles all notifications.

When the user logs off I remove the deviceID from my database. Now I need to find the trigger that is activated when someone removes the app from his (or hers) phone. Because I need to remove the deviceID at that moment as well.

I tried the code below, but “unregister” does not exist

pushObject.on('unregister').subscribe((data: any) => { ... });

Can anybody tell me how to know when someone removes an app?


#2

And what happens when somebody goes to “Settings” and remove the option to receive push-messages? Will this action trigger something within the app so I can register it in the database?