You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ti...@apache.org on 2020/03/30 10:47:42 UTC

[cordova-plugin-inappbrowser] branch master updated: [GH-652] add check for openInSystem postNotification (#654)

This is an automated email from the ASF dual-hosted git repository.

timbru31 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-inappbrowser.git


The following commit(s) were added to refs/heads/master by this push:
     new 11ba4c4  [GH-652] add check for openInSystem postNotification (#654)
11ba4c4 is described below

commit 11ba4c4e7e4f503b7d589339b9b9d6060970ac66
Author: Jim Wright <j-...@users.noreply.github.com>
AuthorDate: Mon Mar 30 11:47:30 2020 +0100

    [GH-652] add check for openInSystem postNotification (#654)
    
    Co-authored-by: Jim Wright <ji...@masabi.com>
---
 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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org