- (BOOL)isAllowedNotification {
//iOS8
if ([[UIDevice currentDevice].systemVersion floatValue]>=8.0){// system is iOS8
UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
if (UIUserNotificationTypeNone != setting.types) {
return YES;
}
} else {
//iOS7
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if(UIRemoteNotificationTypeNone != type) {
return YES;
}
}
return NO;
}
iOS开发——判断用户是否开启了应用推送设置
最新推荐文章于 2023-08-23 14:39:27 发布