Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8556

handleOpenURL functionality to be removed to a plugin

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 4.0.0
    • Fix Version/s: 4.0.0
    • Component/s: cordova-ios
    • Labels:
      None

      Description

      It's already pluginized due to CB-7606

      In 4.0.0, remove the plugin from core and put it in cordova-plugins. Possibility of release as a core plugin, not sure.

      This will include functionality to configure the callback function that is called, which is currently a global handleOpenURL function.

      Remove/edit the note here as well: https://github.com/apache/cordova-ios/blob/b3c26fcd598da7c84f020f5a6b9309fe638cbb5d/guides/Cordova%20Custom%20URL%20Scheme%20Handling.md

        Issue Links

          Activity

          Hide
          shazron Shazron Abdullah added a comment -

          Opting for keeping it in core for now, the plugin is loaded at startup in config.xml (see CB-8678). However, I don't like hardcoding it to the global handleOpenURL (it could be a (global) param value, even settable in js, but then there'd be timing issues), but for backwards compat reasons it's ok for now :/

          Show
          shazron Shazron Abdullah added a comment - Opting for keeping it in core for now, the plugin is loaded at startup in config.xml (see CB-8678 ). However, I don't like hardcoding it to the global handleOpenURL (it could be a (global) param value, even settable in js, but then there'd be timing issues), but for backwards compat reasons it's ok for now :/
          Hide
          shazron Shazron Abdullah added a comment -

          Both UIWebView and WKWebView handle warm and cold starts for the app scheme (handleOpenURL). The plugin is ready for extraction.

          Show
          shazron Shazron Abdullah added a comment - Both UIWebView and WKWebView handle warm and cold starts for the app scheme (handleOpenURL). The plugin is ready for extraction.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 5d5588f6926b0aca994ba97935a01e2c89bce855 in cordova-plugins's branch refs/heads/master from Shazron Abdullah
          [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugins.git;h=5d5588f ]

          CB-8556 - fix handleOpenURL for WKWebViewEngine plugin

          Show
          jira-bot ASF subversion and git services added a comment - Commit 5d5588f6926b0aca994ba97935a01e2c89bce855 in cordova-plugins's branch refs/heads/master from Shazron Abdullah [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugins.git;h=5d5588f ] CB-8556 - fix handleOpenURL for WKWebViewEngine plugin
          Show
          shazron Shazron Abdullah added a comment - http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/2eea1392
          Hide
          shazron Shazron Abdullah added a comment - - edited

          This is failing on CDVWKWebViewEngine because CDVPageDidLoadNotification is not posted once the page is loaded.

           [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:self.webView]];
          

          CDVWKWebViewEngine needs to have a navigationDelegate that implements:

          - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
          

          ... which then will post CDVPageDidLoadNotification

          Show
          shazron Shazron Abdullah added a comment - - edited This is failing on CDVWKWebViewEngine because CDVPageDidLoadNotification is not posted once the page is loaded. [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:self.webView]]; CDVWKWebViewEngine needs to have a navigationDelegate that implements: - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation ... which then will post CDVPageDidLoadNotification
          Hide
          shazron Shazron Abdullah added a comment -

          Tested on CDVUIWebViewEngine using steps in CB-7606 - works as expected.

          Show
          shazron Shazron Abdullah added a comment - Tested on CDVUIWebViewEngine using steps in CB-7606 - works as expected.
          Hide
          shazron Shazron Abdullah added a comment -

          Since the plugin code has been altered to support CDVWebViewEngineProtocol and is now async, this must be re-tested to ensure that it works on both cold and warm starts before it is broken out.

          Show
          shazron Shazron Abdullah added a comment - Since the plugin code has been altered to support CDVWebViewEngineProtocol and is now async, this must be re-tested to ensure that it works on both cold and warm starts before it is broken out.
          Hide
          sandstrom sandstrom added a comment - - edited

          I'd vote for a core plugin!

          In sync with Android, such that the two platforms behaves similarly on custom protocols/urls (to the extent possible).

          Show
          sandstrom sandstrom added a comment - - edited I'd vote for a core plugin! In sync with Android, such that the two platforms behaves similarly on custom protocols/urls (to the extent possible).

            People

            • Assignee:
              shazron Shazron Abdullah
              Reporter:
              shazron Shazron Abdullah
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development