我收到推送通知时打开SFSafariViewController。它一直运行良好,并且在除iOS 11之外的所有iOS版本上仍然可以正常工作。我使用的是ViewController类中的代码。
NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"http://google.com"]];
SFSafariViewController *sfvc = [[SFSafariViewController alloc] initWithURL:URL];
UIWindow *alertWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
alertWindow.rootViewController = [[UIViewController alloc] init];
[alertWindow makeKeyAndVisible];
[alertWindow.rootViewController presentViewController:sfvc animated:YES completion:nil];