vti*_*tim 5 push-notification apple-push-notifications ios
第一次打电话registerForRemoteNotificationTypes:给你的UIApplication对象,a UIAlertView弹出说"[app]想要发送推送通知".
有没有办法知道何时点击"确定"或"不允许" AlertView?
即使在用户做出决定之前application:didRegisterForRemoteNotificationsWithDeviceToken:,我的目前也会被调用AppDelegate.
我想问的原因是因为第一次启动,我要推一个ViewController与Notification选择,但前提是用户表示,他们希望收到通知.
您可以使用下一个方法UIApplication:
返回应用程序接受的通知类型。
- (UIRemoteNotificationType)enabledRemoteNotificationTypes
Run Code Online (Sandbox Code Playgroud)
例如,
UIRemoteNotificationType status = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (status == UIRemoteNotificationTypeNone)
{
NSLog(@"user is not subscribed to receive push notifications");
}
Run Code Online (Sandbox Code Playgroud)