How to check Notification alert style for our app?

廉价感情. 提交于 2019-12-04 15:29:00

You can't change or detect the style of notification programmatically, only the user change this in the settings app.

You also can't open the settings app anymore, thus it will be up to the user who the notification will be displayed. It's totally out of your control.

Like you stated you could ask the user to change the way notification are displayed for your app.

1.The application can check which notification types are enabled using this:

UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];

2.You can not directly open Setting app screen programmatically now.

You can use this in iOS versions 5.0 - 5.0.1.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://"]];

But it was then depreciated in iOS 5.1. You can not use it for iOS 5.1 and later.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!