简体   繁体   中英

How to partially Enable/disable Remote push notifications client side?

I know how to enable/disable push notifications in an iOS app thanks to the help of this question .

But I need to enable/disable push notifications app-side for a particular thread in the app. For example in chat section I have multiple chat rooms and I want to enable/disable push notification for the particular chat room.

Any help on how to achieve this is appreciated.

As the comment suggest, the best way to achieve this is to change your logic back-end regarding when the notifications are sent and allow the user to subscribe/unsubscribe to each set of notifications separately.

App-side, a potential, very roundabout solution might be to send silent push notifications, using content-available ( see here ), implementing whatever logic is necessary to determine if the user should be shown a notification, then presenting a local notification if necessary. I stress that this is not a solution I advocate, but using it would depend on what control you have over the back end.

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