Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1234] TiAPI: Fire events from inside WebView; 2-way communication (Proposed Solution)

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-05-02T22:33:14.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsTiAPI
Labelscore
ReporterThomas Aylott
AssigneeIngo Muschenetz
Created2011-04-15T02:47:19.000+0000
Updated2017-05-02T22:33:14.000+0000

Description

Problem:

I want to be able to deeply integrate a WebView into my app.
I need my WebView code to communicate with my Ti code even if it's generated source, an external url or whatever.

Solution:

Use the common solution from normal Objective-C UIKit/Cocoa apps.
Create a custom url scheme and then override webView:shouldStartLoadWithRequest:navigationType:.

http://github.com/subtleGradient/titanium_mobile/tree/develop-webview-shouldStartLoadWithRequest-handler"> http://github.com/subtleGradient/titanium_mobile/tree/develop-webvi...

http://github.com/subtleGradient/titanium_mobile/blob/30fbb3fb002544f6190145d459fc084e27a76975/demos/KitchenSink/Resources/examples/web_views.js#L77-99"> http://github.com/subtleGradient/titanium_mobile/blob/30fbb3fb00254...

http://github.com/subtleGradient/titanium_mobile/blob/30fbb3fb002544f6190145d459fc084e27a76975/demos/KitchenSink/Resources/examples/webview-fireevent.html"> http://github.com/subtleGradient/titanium_mobile/blob/30fbb3fb00254...

Comments

  1. Thomas Aylott 2011-04-15

    Signed my CLA!

    Rebased with master

    See the latest comparison

    http://github.com/subtleGradient/titanium_mobile/compare/master...develop-webview-shouldStartLoadWithRequest-handler"> http://github.com/subtleGradient/titanium_mobile/compare/master...d...

  2. Stephen Tramer 2011-04-15

    Is this a pull request? Maybe we can review it if it is.

  3. Stephen Tramer 2012-07-25

    Feature request.
  4. Bryan Hughes 2012-07-26

    Is this proposed for iOS only? We need to consider parity for Android and Mobile Web.
  5. Sindre Sorhus 2012-08-11

    Any updates on this? Could really use it in a project I'm working on.
  6. Lee Morris 2017-05-02

    Resolving ticket as Invalid as there is now a new version of Kitchen Sink available.

JSON Source