简体   繁体   English

iOS:确定用户已关闭来自APNS提供商的推送通知

[英]iOS: Identify User turned off Push Notification from APNS provider

I am trying to find if user turned off push notification from APNS provider. 我正在尝试查找用户是否关闭了来自APNS提供商的推送通知。

Here is the scenario 这是场景

  1. User register for APNS and registers the token with Provider. 用户注册APNS并向提供商注册令牌。
  2. User turns off notification from the settings. 用户从设置中关闭通知。
  3. The app is currently not running.. 该应用程序当前未运行。

If provider tries to send any push notification to the device will it fail? 如果提供商尝试将任何推送通知发送到设备,它将失败吗? or if I query the feedback service will it report it? 或者,如果我查询反馈服务,它将报告它吗?

From my testing so far, the APNS returns success even after user turned off push notification and feedback service does NOT report the token. 从到目前为止的测试来看,即使用户关闭了推送通知并且反馈服务未报告令牌,APNS仍会返回成功。

Whereas if User uninstall the app I can see the device token on Feedback service. 而如果用户卸载应用程序,则可以在“反馈”服务上看到设备令牌。

The push notification workflow has been tedious with no request/response model. 推送通知工作流程很繁琐,没有请求/响应模型。 Every time you send a push notification, you must then poll the APNS Feedback service to check each device token is still accepting your pushes. 每次发送推送通知时,您都必须轮询APNS反馈服务,以检查每个设备令牌仍在接受您的推送。

Based on WWDC video, since iOS 9, we will get feedback if push receiver turned off push notification when we send push notification. 基于WWDC视频,从iOS 9开始,如果在发送推送通知时推送接收器关闭了推送通知,我们将获得反馈。

Check this link 检查此链接

The APNS Feedback server will take time to update push token status. APNS反馈服务器将花费一些时间来更新推送令牌状态。 It looks like not a dynamic synchronise service, currently. 目前看来不是动态同步服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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