Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: Release 3.2.2
-
Fix Version/s: Release 3.4.0
-
Component/s: Android
-
Environment:
Android API Level 11 - 18
-
Sprint:2014 Sprint 12 SDK
Description
Issue description
App is using application level events to communicate with WebViews - by using calls to Ti.App.fireEvent() and Ti.App.addEventListener().
Steps to reproduce
- Grab app.js and logging.html
- Click webView "fromWebView" button. Alert shows message.
- Click app "fromTitanium" button. Message displayed as expected.
- Click "cleanUp" button. Alert fires message.
- If you click twice the console message shows TiViewProxy released although function keeps listening event.
Android monitor
03-24 18:22:48.531: E/TiViewProxy(12371): (KrollRuntimeThread) [102323,132456] Add called with null child
|
If you attempt to run it on iOS, event listener isn't available after a second time Studio output
[INFO] : Application started
|
[INFO] : TiAppEvents/1.0 (3.2.2.GA.96e9a07)
|
[DEBUG] : Loading: /Users/egomez/Library/Application Support/iPhone Simulator/7.1/Applications/CD516444-41E2-4BEE-BACD-ADEE0049F7ED/TiAppEvents.app/_app_props_.json, Resource: _app_props__json
|
[DEBUG] : Application booted in 122.496009 ms
|
[DEBUG] : New scheme: <NSMutableURLRequest: 0x10883db0> { URL: file:///Users/egomez/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/CD516444-41E2-4BEE-BACD-ADEE0049F7ED/TiAppEvents.app/logging.html }
|
[DEBUG] : Loading: /Users/egomez/Library/Application Support/iPhone Simulator/7.1/Applications/CD516444-41E2-4BEE-BACD-ADEE0049F7ED/TiAppEvents.app/logging.html, Resource: logging_html
|
[DEBUG] : Firing app event: app:fromTitanium
|
[ERROR] : Script Error {
|
[ERROR] : backtrace = "#0 () at :0";
|
[ERROR] : line = 93;
|
[ERROR] : message = "Invalid type passed to function";
|
[ERROR] : nativeLocation = "-[TiViewProxy remove:] (TiViewProxy.m:225)";
|
[ERROR] : nativeReason = "expected: TiViewProxy, was: NSNull";
|
[ERROR] : sourceId = 267172160;
|
[ERROR] : sourceURL = "file:///Users/egomez/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/CD516444-41E2-4BEE-BACD-ADEE0049F7ED/TiAppEvents.app/app.js";
|
[ERROR] : }
|
Cleanup is called when developer want to dispose of the webview that was added to the view. That last Ti.App.removeEventListener("app:fromTitanium", fromTitanium); fails to work though since the fromTitanium function actually sits in the webView. All we want to do is ensure that the fromTitanium event listener added to the webview is removed once the webview is destroyed.
Attachments
Issue Links
- links to