我如何忽略推送通知 [英] how do I disregard push notifications

查看:28
本文介绍了我如何忽略推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用中有一个设置可以打开/关闭推送通知,它存储在 NSUserDefaults 中.现在我的理解是,如果我们订阅频道,我们将始终收到推送通知.但是,如果用户关闭此设置,他/她不一定要取消订阅,但可能会暂时关闭它.那么如何在不实际取消订阅频道的情况下忽略推送通知?

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?

推荐答案

这可以在后端处理 ... 当用户关闭推送通知时,将他的设备令牌发送到您的服务器(通过 api 函数)然后当您发送通知时,您将忽略所有选择关闭通知服务的设备令牌.

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.

这篇关于我如何忽略推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆