Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26518

Android: Webview FireEvent not get fired in correct sequence

    Details

    • Type: Story
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: Release 7.4.1
    • Fix Version/s: Release 8.0.0
    • Component/s: Android
    • Labels:
      None
    • Environment:
    • Story Points:
      3
    • Sprint:
      2018 Sprint 23

      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

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                aislam Aminul Islam
                Reviewer:
                Yordan Banev
                Tester:
                Samir Mohammed
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-6670
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code