[TIMOB-26518] Android: Webview FireEvent not get fired in correct sequence
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-11-06T18:00:38.000+0000 |
Affected Version/s | Release 7.4.1 |
Fix Version/s | Release 8.0.0 |
Components | Android |
Labels | n/a |
Reporter | Aminul Islam |
Assignee | Gary Mathews |
Created | 2018-11-05T12:40:30.000+0000 |
Updated | 2018-11-16T11:59:48.000+0000 |
Description
Hi team,
For Android Platform, I have added "evenlistener" in webview local html file. The event is fired from app.js. The issue is, fireEvent get fired in reverse order for Android.
For iOS, the sequence is right and for Android, the sequence is wrong.
App.js
var win = Ti.UI.createWindow({
});
var webView = Ti.UI.createWebView({
visible : false,
url : 'index.html'
});
win.add(webView);
webView = null;
win.open();
setTimeout(function() {
for (var i = 0; i < 5; i++) {
var data = {
value : i
};
Ti.API.info("value passed:" + i);
Ti.App.fireEvent('testevent', data);
}
}, 5000);
index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
</head>
<body>
<script type="text/javascript">
function passdatatoserver(e) {
Ti.API.info("testevent:" + e.value);
}
Ti.App.addEventListener('testevent', passdatatoserver);
</script>
</body>
</html>
Log for adroid:
[INFO] : value passed:0
[INFO] : value passed:1
[INFO] : value passed:2
[INFO] : value passed:3
[INFO] : value passed:4
[WARN] : TiVerify: (Timer-0) [4992,4993] Verifying module licenses...
[INFO] : I/System.out: Thread-63102(ApacheHTTPLog):Reading from variable values from setDefaultValuesToVariables
[INFO] : I/System.out: Thread-63102(ApacheHTTPLog):isSBSettingEnabled false
[INFO] : I/System.out: Thread-63102(ApacheHTTPLog):isShipBuild true
[INFO] : I/System.out: Thread-63102(ApacheHTTPLog):getDebugLevel 0x4f4c
[INFO] : I/System.out: Thread-63102(ApacheHTTPLog):Smart Bonding Setting is false
[INFO] : I/System.out: Thread-63102(ApacheHTTPLog):SmartBonding Setting is false, SHIP_BUILD is true, log to file is false, DBG is false, DEBUG_LEVEL (1-LOW, 2-MID, 3-HIGH) is 1
[INFO] : I/System.out: Timer-0 calls detatch()
[INFO] : TiVerify: (Timer-0) [838,5831] Succesfully verified module licenses
[INFO] : testevent:4
[INFO] : testevent:3
[INFO] : testevent:2
[INFO] : testevent:1
[INFO] : testevent:0
Test Environment:
Operating System
Name = Microsoft Windows 10 Pro
Version = 10.0.17134
Architecture = 32bit
# CPUs = 4
Memory = 17091956736
Node.js
Node.js Version = 8.9.1
npm Version = 5.5.1
Titanium CLI
CLI Version = 5.1.1
Titanium SDK
SDK Version = 7.4.1.GA
Attachments
File | Date | Size |
---|---|---|
androidlogs.png | 2018-11-05T12:41:00.000+0000 | 12668 |
ioslogs.png | 2018-11-05T12:41:00.000+0000 | 13278 |
master: https://github.com/appcelerator/titanium_mobile/pull/10422
*Closing ticket*. Fix verified in SDK Version
8.0.0.v20181114074027
Webview FireEvent now gets fired in correct sequence. *Test steps (FR passed):*Created a new titanium project
Added the test case from https://github.com/appcelerator/titanium_mobile/pull/10422
Ran the program
Following output was seen (Correct sequence):
*Test Environment*