iOS Urban Airship取消注册通知

时间:2013-05-28 10:14:07

标签: ios urbanairship.com

美好的一天,

可在iOS上使用适用于Urban Airship的API进行注册。基本上只是

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

然而,似乎没有任何API可以取消注册设备接收通知。我能做什么?我的意思是我可以"注册"它是一个"不活跃"别名帐户,但这似乎不太好。

1 个答案:

答案 0 :(得分:0)

像这样使用此方法unregisterForRemoteNotifications

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

以下是Apple文档对此方法的说法

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