iOS8 通知设置


无意中安装了钉钉,发现现在把提示的通知关闭后,进入首页会弹出来一个手动打开通知的办法,感觉以后也可能会遇见,分享大家下,先看一下钉钉的页面。


先看一下代码

if ([[UIApplication sharedApplication] currentUserNotificationSettings].types  == UIUserNotificationTypeNone){// 判断通知是否打开

}

跳转方法

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"你现在无法收到新消息通知,请到系统“设置”-“通知”-“QQ“中开启"  preferredStyle:UIAlertControllerStyleAlert];

[alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault  handler:^(UIAlertAction *action)

{

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];

}]];

[alertController addAction:[UIAlertAction actionWithTitle:@"不再提示" style:UIAlertActionStyleCancel  handler:^(UIAlertAction *action)

{

}]];

[self presentViewController:alertController animated:YES completion:^{

}];

希望大家能用上。。。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容