|
@@ -35,7 +35,15 @@ bool SDL_SYS_OpenURL(const char *url)
|
|
|
#else
|
|
|
NSString *nsstr = [NSString stringWithUTF8String:url];
|
|
|
NSURL *nsurl = [NSURL URLWithString:nsstr];
|
|
|
- return [[UIApplication sharedApplication] openURL:nsurl];
|
|
|
+ if (![[UIApplication sharedApplication] canOpenURL:nsurl]) {
|
|
|
+ return SDL_SetError("No handler registerd for this type of URL");
|
|
|
+ }
|
|
|
+ if (@available(iOS 10.0, *)) {
|
|
|
+ [[UIApplication sharedApplication] openURL:nsurl options:@{} completionHandler:^(BOOL success) {}];
|
|
|
+ } else {
|
|
|
+ [[UIApplication sharedApplication] openURL:nsurl];
|
|
|
+ }
|
|
|
+ return true;
|
|
|
#endif
|
|
|
}
|
|
|
}
|