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

iOS: WebView does not receive 'pause' event

    Details

      Description

      first try:

      x.js

      Ti.UI.createWebView({ url:'y.html' });
      

      y.html:

      Ti.App.addEventListener('pause', function() { Ti.API.log('you won't see this message'); });
      

      upon pausing the app, the handler does not get invoked. i then tried another alternative:

      x.js

      Ti.UI.createWebView({ url:'y.html' });
      Ti.App.addEventListener('pause', function() { Ti.API.log('ok, fire'); Ti.App.fireEvent('app.pause'); });
      

      y.html:

      Ti.App.addEventListener('app.pause', function() { Ti.API.log('you won't see this message either'); });
      

      this time the pause event gets caught, 'app.pause' gets fired, but still the webview stays silent. somehow this leads me to the conclusion that webviews won't receive events after an app entered the 'pause' state, because other event handlers work just fine while the app is in running mode.

      A complete usecase supplied by Rick Blalock:

      var webview = Ti.UI.createWebView({
          url: "test.html"
      })
       
      var win = Ti.UI.createWindow();
       
      win.add(webview);
      win.open();
       
      Ti.App.addEventListener("pause", function() {
          Ti.API.info("Pause event received");
          Ti.App.fireEvent("appPaused");
      });
       
      Ti.App.addEventListener("appPaused", function() {
          Ti.API.info("App.js received appPaused event");
      });
      

      <html>
      <head>
      <title></title>
      <script type="text/javascript">
      	Ti.App.addEventListener("appPaused", function(_event) {
      		Ti.API.info("WebView received appPaused event");
      	});
      </script>
      </head>
      <body>
      </body>
      </html>
      

        Attachments

          Activity

            People

            • Assignee:
              stephentramer Stephen Tramer
              Reporter:
              tom tom quas
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code