在以下代码中,获取设备令牌 但是不会出现确认推送通知许可的警报视图 也许是因为这个原因,虽然发送推送通知,但它没有到达设备 你知道为什么不出现警报吗?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[application registerForRemoteNotifications];
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSString *deviceTokenString = [deviceToken.description stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
deviceTokenString = [deviceTokenString stringByReplacingOccurrencesOfString:@" " withString:@""];
NSLog(@"DeviceToken: %@", deviceTokenString);
}