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

Windows: Ti.App.fireEvent and listener doesnt work in static javascript/html page loaded in webview

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: Release 5.1.2
    • Fix Version/s: Release 5.3.0
    • Component/s: Windows
    • Environment:

      Titanium SDK: 5.1.1/5.1.2
      Platform: Windows phone
      Operating system: Windows 10 & Visual Studio 2013 with 8.1 SDK

      Description

      While building a simple app for all three platforms we used leaflet map with webview. While android and ios had no issues communicating with javascript embedded in web page, there is no communication with webview on windows phone platform. I have made a simple project in which i can get response in android/ios but not windows phone:

      logging.html
      <html>
      <head>
      <script>
      Ti.App.addEventListener("app:fromTitanium", function(e)

      { alert(e.message); }

      );
      </script>
      </head>
      <body>
      <button onclick="Ti.App.fireEvent('app:fromWebView',

      { message: 'event fired from WebView, handled in Titanium' }

      );">fromWebView</button>
      </body>
      </html>

      index.js

      var win = Ti.UI.createWindow();
      var webview = Ti.UI.createWebView(

      { url: 'logging.html' }

      );
      var button = Ti.UI.createButton(

      { title: 'fromTitanium', height: '50dp', width: '130dp' }

      );
      button.addEventListener('click', function(e) {
      Ti.App.fireEvent('app:fromTitanium',

      { message: 'event fired from Titanium, handled in WebView' }

      );
      });
      Ti.App.addEventListener('app:fromWebView', function(e)

      { alert(e.message); }

      );
      win.add(webview);
      win.add(button);
      win.open();

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                nejcrobnik Nejc Robnik
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code