1、检测是否开启本地应用推送功能
-(BOOL)isOpenNotification{
if([[[UIDevice currentDevice] systemVersion]floatValue]>=8.0){
UIUserNotificationType types=[[UIApplication sharedApplication]currentUserNotificationSettings].types;
return (types & UIRemoteNotificationTypeAlert);
}else{
UIRemoteNotificationType types=[[UIApplication sharedApplication]enabledRemoteNotificationTypes];
return (types & UIRemoteNotificationTypeAlert);
}
}
2、跳转对应应用开启推送允许通知
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"prefs:root=NOTIFICATIONS_ID&&path=xxxxx"]];
“xxxx”是指你的bundleid