You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Dan Polivy (JIRA)" <ji...@apache.org> on 2018/08/08 16:22:00 UTC

[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs

    [ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16573442#comment-16573442 ] 

Dan Polivy commented on CB-14234:
---------------------------------

[~jcesarmobile]: I'm looking into this, and was wondering if the logic could be simplified to use the return value from openURL to determine whether to post the notification within the app. openURL returns a BOOL indicating whether the URL was successfully opened ([https://developer.apple.com/documentation/uikit/uiapplication/1622961-openurl?language=objc)] – would a better fix be to check the return value from that, and if it is NO _then_ we post the notification within the app?

I am still curious as to the reason why the notification would be posted to the app at all. I don't see a scenario when you explicitly try to open a URL in the system browser where it would be expected to open in the app instead. That code appears to have been in there from the beginning, though, so I don't know the context/history under which it was added, and whether removing it would break any existing use case. cc:[~hermwong] who made the initial commit, in case he has insight to share.

 

I'm happy to submit a PR but would appreciate some input first.

> InAppBrowser iOS calls handleOpenURL in same app for _system URLs
> -----------------------------------------------------------------
>
>                 Key: CB-14234
>                 URL: https://issues.apache.org/jira/browse/CB-14234
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-inappbrowser
>    Affects Versions: 3.0.0
>            Reporter: Dan Polivy
>            Priority: Minor
>
> The change to fix CB-11178 has caused some undesirable behavior with InAppBrowser on iOS. Now, whenever you try to open a URL in the system browser, by calling `cordova.InAppBrowser.open(url, "_system")`, it opens the system browser AND calls `handleOpenURL` _in your app_ with the same URL.
> In my case, my app is a URL handler for a corresponding web domain (app links). I am trying to open a page on this web domain in the system browser from within my app. If my app's handleOpenURL is called with a URL also on the domain, then my handler thinks it is handling an app link and it causes the app to navigate to another URL, which in this case is not desired or expected.
> Prior to the fix for CB-11178, this worked perfectly. Is there any other way to address the fix for CB-11178 without inheriting this incorrect and undesirable behavior?
> [~jcesarmobile]: FYI as you committed the fix in question.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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