Stop push notifications

I am working on an application that has a push notification in it. I implemented it, but my problem is that I want to receive notifications only when the user logs in to the application. Something like an iPhone email application. Any ideas how I can fix this?

+4
source share
2 answers

You can delete the saved device token from the APNS provider when the user exits your application.

+2
source

You cannot stop or restrict push notifications in any way after sending .

Until:

(1) the user has your application installed, and

(2) they agreed to allow push notifications on first run, AND

(3) the device is on

then (if you send them a push), they will receive a push notification regardless of whether or not your application is active in the background or not working at all.

If the device is turned off, it will be received when they return the device (provided that the values ​​(1) and (2) above are still correct).

Please note that Push Notifications are NOT guaranteed to be delivered, so you should not use them to send important / important information.

Instead of Push, you probably want to implement something proprietary on your server, where the device connects to your server and checks messages every time the application starts.

0
source

Source: https://habr.com/ru/post/1386697/


All Articles