IOS Push Notification disable/enable on the basis of key

99封情书 提交于 2019-12-13 08:19:20

问题


  1. Just wondering whether there is any way to disable/enable a push notification when it is received.

    For e.g :- When i receive a push notification then i first check in my app whether in notification setting i have enabled or disabled the notification.

  2. There can also be multiple notification settings like

    • To disable a friend request notification
    • To disable message notification

So while sending a notification is there any way to append notificationType like if its for friend request or messaging.

Then after checking the notification type and its corresponding setting in the app, showing or discarding the notification.


回答1:


You can't achieve this just in client side itself. Because once notification arrives it is handled by iOS and displayed in notification centre (or any other type as per user setting). App will not get the notification info, unless it is running.

You can have this as settings in Client and sync it with server to have a check there before pushing the notifications.



来源:https://stackoverflow.com/questions/35747760/ios-push-notification-disable-enable-on-the-basis-of-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!