[TIMOB-1234] TiAPI: Fire events from inside WebView; 2-way communication (Proposed Solution)
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-05-02T22:33:14.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | n/a |
Components | TiAPI |
Labels | core |
Reporter | Thomas Aylott |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T02:47:19.000+0000 |
Updated | 2017-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
- 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...
- Stephen Tramer 2011-04-15
Is this a pull request? Maybe we can review it if it is.
- Stephen Tramer 2012-07-25 Feature request.
- Bryan Hughes 2012-07-26 Is this proposed for iOS only? We need to consider parity for Android and Mobile Web.
- Sindre Sorhus 2012-08-11 Any updates on this? Could really use it in a project I'm working on.
- Lee Morris 2017-05-02 Resolving ticket as Invalid as there is now a new version of Kitchen Sink available.