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

iOS: Missing app-state-events for fresh launch and background-launch

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Duplicate
    • Affects Version/s: Release 3.2.3, Release 3.3.0, Release 3.4.0, Release 3.4.1
    • Fix Version/s: None
    • Component/s: iOS
    • Environment:

      SDK 3.2.3 iOS 7
      CLI version 3.3.0
      Titanium SDK version 3.2.3.GA, 3.3.0.GA, 3.4.0.GA, 3.4.1.GA

      iOS 7

    • Story Points:
      8
    • Sprint:
      2017 Sprint 22 SDK

      Description

      Problem Description

      1. Titanium mobile app doesn't fire "resumed" event at fresh launch. Based on Apple's doc, "applicationDidBecomeActive:" is called at fresh launch as well. Shouldn't "resumed" be fired at fresh launch?

      2. Based on #1, Shouldn't Titanium mobile app fire "paused" event when app is launched directly into the background? Since "applicationDidEnterBackground:" is called in this case.

      3. There is currently no way to determine whether app is launched into the foreground or the background with Titanium. It is possible with native code, according to Apple's Docs. This feature is highly needed.

      Test case

      1. Create a new mobile project (Classic Titanium)
      2. Copy this code into app.js

      var main_window = Ti.UI.createWindow({
      	backgroundColor: 'green'
      });
      main_window.open();
       
      Titanium.App.addEventListener('pause', function (e) {
          Ti.API.info('app.js: Pause event on '+Ti.Platform.osname);
      }); 
      Titanium.App.addEventListener('paused', function (e) {
          Ti.API.info('app.js: Paused event on '+Ti.Platform.osname);
      });     
      Titanium.App.addEventListener('resume', function (e) {
          Ti.API.info('app.js: Resume event on '+Ti.Platform.osname);
      });
      Titanium.App.addEventListener('resumed', function (e) {
          Ti.API.info('app.js: Resumed event on '+Ti.Platform.osname);
      });
      

      3. Run it into device

      Extra info

      According to the "Apple Doc" The "resumed" event should also called at app fresh launch. According to Apple Doc "applicationDidBecomeActive" is called at fresh launch, which invoke the Titanium.App "resumed" event.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hknoechel Hans Knöchel
                Reporter:
                shawnlan Shawn Lan
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code