Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25862

Parity: Support async Ti.UI.Webview.evalJS call on Android & iOS

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: Release 7.0.2
    • Fix Version/s: Release 7.5.0
    • Component/s: Android, iOS
    • Labels:

      Description

      Issue

      Evaluating Javascript within a Webview is inherently a (possibly) long-running task. On Windows we evalJS accepts a second argument which is a callback function to receive the result (when it's ready). We should support this async variant of the Ti.UI.WebView.evalJS method on Android and iOS (especially now that there's an async method to do exactly this natively in Android as of apilevel-19).

      // Existing sync call example
      // Result is returned sync
      var result = webview.evalJS('1 + 3');
       
      // Async variant
      // this variant doesn't return a a value (basically it returns null or undefined but callers shouldn't use the result)
      // It fires off a thread/whatever to eval the JS and call the callback async.
      webview.evalJS('1 + 3', function (result) {
        // do something with result
      });
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cwilliams Christopher Williams
                Reporter:
                cwilliams Christopher Williams
                Reviewer:
                Hans Knöchel
                Tester:
                Samir Mohammed
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code