[TIMOB-2170] Android: regression in Ti.App.fireEvent from within WebView context on 1.5 trunk
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, android_refactor, events, fireevent, patch, regression, ti.app, webview |
Reporter | Brion Vibber |
Assignee | Marshall Culpepper |
Created | 2011-04-15T03:12:34.000+0000 |
Updated | 2011-04-17T01:58:18.000+0000 |
Description
In testing StatusNet Mobile against the new 1.5 Android code in trunk, I've found that custom application events fired from JavaScript code running within a WebView no longer work. This is needed for our app to communicate between the main UI code and the WebView that displays our message timelines.
I believe I've tracked it to commit 7926eda7aad2fa2073aad2849f4ed890c5807e00
This commit removes AppModule.fireEvent(), which used to override the default KrollProxy event handler function with a call to fireAppEvent() on the current app retrieved from the current context. I believe that breaks the code in TiWebViewBinding.AppBinding.fireEvent(), which calls fireEvent() directly on a private AppModule instance.
With the AppModule.fireEvent() hack removed, it looks like that'll just fire events on the individual instance and not call the global application.
Provisional fix that works for me:
http://github.com/brion/titanium_mobile/tree/2170">http://github.com/brion/titanium_mobile/tree/2170
http://github.com/brion/titanium_mobile/commit/73a02241a1df8b1697e91732861020efda9d6724"> http://github.com/brion/titanium_mobile/commit/73a02241a1df8b1697e9...
http://github.com/appcelerator/titanium_mobile/pull/9">http://github.com/appcelerator/titanium_mobile/pull/9
(from [9a3a817dd712309535cad518dae779ce24b7d5ba]) pull the App and API modules from TiApp instead of creating them for each instance, thanks to Brion Vibber for the find and suggestion. also cleared up some warnings [#2170 state:fixed-in-qa] http://github.com/appcelerator/titanium_mobile/commit/9a3a817dd712309535cad518dae779ce24b7d5ba"> http://github.com/appcelerator/titanium_mobile/commit/9a3a817dd7123...
Titanium SDK version: 1.5.0 (12/04/10 08:46 b7b9e78)