新消息通知
- (void)judge { BOOL isNotifyAlert = NO, isNotifySound = NO; if (IOS8) { UIUserNotificationType types = [[UIApplication sharedApplication] currentUserNotificationSettings].types; isNotifyAlert = (types & UIUserNotificationTypeAlert) == UIUserNotificationTypeAlert; isNotifySound = (types & UIUserNotificationTypeSound) == UIUserNotificationTypeSound; } else { UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; isNotifyAlert = (types & UIRemoteNotificationTypeAlert) == UIRemoteNotificationTypeAlert; isNotifySound = (types & UIRemoteNotificationTypeSound) == UIRemoteNotificationTypeSound; }
NSLog(@"-------------推送开关, 接收:%@, 声音:%@", isNotifyAlert?@"yes":@"no",isNotifySound?@"yes":@"no");
}