0

再会,

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

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

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

4

1 回答 1

0

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
于 2013-05-28T10:18:03.413 回答