直接从支持iOS8 +的iOS应用redirect到通知设置
我的要求是,如果应用程序的通知被用户closures,用户在那个时候打开应用程序,它会给应用程序打开通知警报,当点击警报视图应用程序的OKbutton将redirect到通知屏幕用户需要点击开关button才能打开通知。
是否有可能在ios8 +?
我想redirect这个屏幕
谢谢
此代码将redirect到设置通知。
if ([[UIApplication sharedApplication] currentUserNotificationSettings].types != UIUserNotificationTypeNone) { NSLog(@" Push Notification ON"); } else { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Push Notification Service Disable ,please enable it." message:nil preferredStyle:UIAlertControllerStyleAlert]; [alertController addAction:[UIAlertAction actionWithTitle:@"Okay!" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { @try { NSLog(@"tapped ok"); BOOL canOpenSettings = (UIApplicationOpenSettingsURLString != NULL); if (canOpenSettings) { NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; [[UIApplication sharedApplication] openURL:url]; } } @catch (NSException *exception) { } }]]; [self.view presentViewController:alertController animated:YES completion:^{}]; }
它将redirect到以下屏幕