From 11ba4c4e7e4f503b7d589339b9b9d6060970ac66 Mon Sep 17 00:00:00 2001 From: Jim Wright Date: Mon, 30 Mar 2020 11:47:30 +0100 Subject: [PATCH] [GH-652] add check for openInSystem postNotification (#654) Co-authored-by: Jim Wright --- src/ios/CDVWKInAppBrowser.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 @@ static CDVWKInAppBrowser* instance = nil; - (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