问题
I have a settings in my app to be able to turn on/off push notifications, this is stored in NSUserDefaults. Now the way I understand it is that we'll always get push notifications if we subscribe to a channel. However, if a user turns this settings to off this doesn't necessarily he/she wants to unsubscribe for it, but maybe turn it off temporarily. How do I then disregard the push notifications without actually unsubscribing to the channel?
回答1:
This can be handled in the back end side ... when the user turn off the push notification send his device token to your server (through api function) then when you send a notification you will ignore all the device's token who choose to turn off the notification service.
来源:https://stackoverflow.com/questions/9968628/how-do-i-disregard-push-notifications