简体   繁体   中英

Don't show push notifications

Is there an opportunity to stop showing push notifications via an app?

I have an app connected to a database. When someone sends me something like a message I will get a push on my devices (lock-)screen. But if the user does not want to see specific notifications for something, maybe a new message by person XY, it should not appear! So is there an opportunity for hide specific pushs via the app or do I have stop them server-side?

You'll have to make the change server-side. From the app side, you can't stop only certain push notifications, because it's while the app is backgrounded (or not even running) that push notifications will be showing, so your app has no control over whether specific ones will show or not.

If the app is not in the foreground then the push notifications don't get delivered to the app, they get delivered directly to the user and hence there is no chance for the app to intervene and filter them.

BUT if your app is for iOS7 only then you could use silent background push notifications, then when the push is delivered the OS will rouse your app and the push will be delivered to it, then the app can examine the content of the push and also examine the user preferences and then present the background push as a local push or not (to the user a local push looks just like a remote push).

One caveat is that if the user forcefully terminates your app (by upwardly swiping it out of the task manager) and the user has not restarted it then the OS will not deliver the silent push to it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM