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

Deprecate window.invokeString - use window.handleOpenURL(url) instead

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • cordova-ios
    • None

    Description

      Don't know about the other platforms, but there are two ways it is handled in iOS right now, we need to consolidate.

      Summary:
      The url scheme passed to the app is a form of inter-process communication, kinda like how we do gap:// urls, but this is up to the app developer on how they marshal/unmarshal the url into something they can use.

      Right now in iOS, it is a bit confusing - there are two ways that the URL is handled and passed off to the UIWebView.

      1. On first app startup, the URL sent is passed off to the UIWebView by setting a global variable - window.invokeString. The URL is passed off untouched (see: https://github.com/apache/incubator-cordova-ios/blob/master/Cordova-based%20Application/Classes/AppDelegate.m#L67)

      2. On all launches, the handleOpenURL function is called, and this in turn calls the global JavaScript function in the UIWebView window.handleOpenURL() and this is passed the URL, untouched (see: https://github.com/apache/incubator-cordova-ios/blob/master/Cordova-based%20Application/Classes/AppDelegate.m#L126)

      Apple Doc reference: http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW21

      Recommend sticking to handleOpenURL only, deprecate window.invokeString

      Attachments

        Issue Links

          Activity

            People

              shazron Shazron Abdullah
              shazron Shazron Abdullah
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: