在通知應用程序沒有註冊的兒子和徽章。iOS 8的遠程通知
這是我的代碼:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
//-- Set Notification
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.000000) {
UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
//[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
有人有一個解釋?謝謝
有什麼不好?你能指望什麼? – vikingosegundo 2014-09-23 19:41:41
看看' - [NSProcessInfo isOperatingSystemAtLeastVersion:]'。 – wjl 2014-09-23 19:47:49
謝謝你的回答 – dev1001 2014-09-24 14:23:37