【问题标题】:iOS Urban Airship de-register notificationsiOS Urban Airship 注销通知
【发布时间】:2013-05-28 10:14:07
【问题描述】:

美好的一天,

Urban Airship 的 iOS 上的 API 可供注册。基本上它只是

[[UAPush shared] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
                                                     UIRemoteNotificationTypeSound |
                                                     UIRemoteNotificationTypeAlert)];

但是,似乎根本没有任何 API 可以取消注册设备以接收通知。我能做些什么?我的意思是我可以将它“注册”到“非活动”别名帐户,但这似乎不太好。

【问题讨论】:

  • 可以从应用设置页面停止接收通知。够了吗?

标签: ios urbanairship.com


【解决方案1】:

像这样使用unregisterForRemoteNotifications这个方法

[[UIApplication sharedApplication] unregisterForRemoteNotifications];
[[UAirship shared] unRegisterDeviceToken];

这是苹果文档对这种方法的描述

Unregister for notifications received from Apple Push Service.
- (void)unregisterForRemoteNotifications
Discussion

You should call this method in rare circumstances only, such as when a new version of the application drops support for remote notifications. Users can temporarily prevent applications from receiving remote notifications through the Notifications section of the Settings application. Applications unregistered through this method can always re-register.
Availability

    Available in iOS 3.0 and later.

See Also

    – registerForRemoteNotificationTypes:
    – enabledRemoteNotificationTypes

Declared In
UIApplication.h

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多