You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Paul Kane (JIRA)" <ji...@apache.org> on 2014/09/22 00:48:33 UTC

[jira] [Updated] (CB-7606) handleOpenURL handler firing more than necessary

     [ https://issues.apache.org/jira/browse/CB-7606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Kane updated CB-7606:
--------------------------
    Description: 
I'm not an Obj-C or Cordova programmer so bear with me.

Let's say my app is running. Then I hop over to my mail app and click on a link (myapp://blahBlahBlah) that should open up my app. This works fine, the app opens, my own URL handler (in javascript) takes over, etc.

However in Obj-C the view controller is -- incorrectly, I believe -- storing that scheme data (blahBlahBlah) in self.openURL (so that it can be picked up later in processOpenURL function, called during webView initialization).

This isn't normally a problem, except when you move to a new page (window.href = "/new_page"), the webView initialization runs again and picks up the old (already-acted-upon) openURL variable. (it's then set to nil, so that it doesn't get acted upon a third time, fourth time, etc...).

I might have some details wrong, but it should be fairly easy to walk through with a project-wide search for "openurl". Just seems like a slightly wrong logic-flow, which unfortunately is interfering with my app.

  was:
I'm not an Obj-C or Cordova programmer so bear with me.

Let's say my app is running. Then I hop over to my mail app and click on a link that should open up my app. This works fine, the app opens, my own URL handler (in javascript) takes over, etc.

However in Obj-C the view controller is -- incorrectly, I believe -- storing that scheme data (myapp://blahBlahBlah) in self.openURL (so that it can be picked up elsewhere, in the processOpenURL function, called during webView initialization).

This isn't normally a problem, except when you move to a new page (window.href = "/new_page"), the webView initialization runs again and picks up the old (already-acted-upon) openURL variable. (it's then set to nil, so that it doesn't get acted upon a third time, fourth time, etc...).

Just seems like a slightly wrong logic-flow, which unfortunately is interfering with my app.


> handleOpenURL handler firing more than necessary
> ------------------------------------------------
>
>                 Key: CB-7606
>                 URL: https://issues.apache.org/jira/browse/CB-7606
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 3.5.0
>            Reporter: Paul Kane
>
> I'm not an Obj-C or Cordova programmer so bear with me.
> Let's say my app is running. Then I hop over to my mail app and click on a link (myapp://blahBlahBlah) that should open up my app. This works fine, the app opens, my own URL handler (in javascript) takes over, etc.
> However in Obj-C the view controller is -- incorrectly, I believe -- storing that scheme data (blahBlahBlah) in self.openURL (so that it can be picked up later in processOpenURL function, called during webView initialization).
> This isn't normally a problem, except when you move to a new page (window.href = "/new_page"), the webView initialization runs again and picks up the old (already-acted-upon) openURL variable. (it's then set to nil, so that it doesn't get acted upon a third time, fourth time, etc...).
> I might have some details wrong, but it should be fairly easy to walk through with a project-wide search for "openurl". Just seems like a slightly wrong logic-flow, which unfortunately is interfering with my app.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)