ios - 停止推送通知

标签 ios objective-c ipad

我的应用程序推送通知使用设备 token 从 C# 应用程序推送。

一旦用户在设备上卸载应用程序,我想停止推送通知。是的,当然它工作正常。

再次安装相同的应用程序。但是它正在接收以前没有登录的用户通知。
如何解决这个问题?...

我已引用此链接 http://42spikes.com/post/Sending-Apple-Push-Notifications-from-a-C-Application.aspx

我的问题:

1) 是否可以在卸载/安装时调用任何方法? (可能意味着我可以访问 Web 服务并重置设备 token 值吗?)。

2) 安装或卸载时还有其他解决此问题的方法吗?

最佳答案

  1. 不,当用户卸载您的应用程序时不会触发任何方法。
  2. 是的, Apple 有一项服务,您可以在其中检查 token 是否仍然存在 有效的。

您要在 C# 应用程序中实现的选项是 The Feedback Service :

The Apple Push Notification Service includes a feedback service to give you information about failed push notifications. When a push notification cannot be delivered because the intended app does not exist on the device, the feedback service adds that device’s token to its list. Push notifications that expire before being delivered are not considered a failed delivery and don’t impact the feedback service. By using this information to stop sending push notifications that will fail to be delivered, you reduce unnecessary message overhead and improve overall system performance.

关于ios - 停止推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18077745/

相关文章:

ios - 隐藏键盘时隐藏快捷方式栏 ios(Ipad)

iOS - 没有滑动背景图像的pushViewController

ios - iOS 7.0 中的 AVSpeechSynthesizer 有美国男声吗?

ios - 创建第一个启动 View Controller

ios - iPhone 4 应用程序使用 sqlite 数据库

ipad - 告诉 MPMoviePlayerViewController 中加载的视频停止播放

ios - 在 FOR 循环中创建和设置 UIButton 的标题会中断循环

ios - “无法同步 iPhone,因为此计算机不再被授权用于此 iPhone : 上的已购买项目

android - 具有 Rails 后端的 Android/iOS 应用程序上的即时消息

ios - 是否可以向 HealthKit 添加自定义数据?