[GH-652] add check for openInSystem postNotification (#654)
Co-authored-by: Jim Wright <jim.wright@masabi.com>
diff --git a/src/ios/CDVWKInAppBrowser.m b/src/ios/CDVWKInAppBrowser.m
index 9aa8c7e..95e198e 100644
--- a/src/ios/CDVWKInAppBrowser.m
+++ b/src/ios/CDVWKInAppBrowser.m
@@ -357,8 +357,10 @@
- (void)openInSystem:(NSURL*)url
{
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
- [[UIApplication sharedApplication] openURL:url];
+ if ([[UIApplication sharedApplication] openURL:url] == NO) {
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
+ [[UIApplication sharedApplication] openURL:url];
+ }
}
- (void)loadAfterBeforeload:(CDVInvokedUrlCommand*)command