Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10475] iOS: resume event it's not fired after unlocking the ipad 2.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionNot Our Bug
Resolution Date2012-09-11T22:14:35.000+0000
Affected Version/sRelease 2.1.1, Release 3.0.0
Fix Version/sn/a
ComponentsiOS
LabelsSupportTeam, api
ReporterMauro Parra-Miranda
AssigneeSabil Rahim
Created2012-08-16T14:11:03.000+0000
Updated2017-03-09T23:46:44.000+0000

Description

Problem description

When you are in an app, and you press the lock button (hardware top right button) and then unlock, the app is not throwing the resume event.

Actual results

The app doesn't throw the resume event after unlocking the screen.

Expected results

After unlocking the screen, the resume event should be thrown (as happens with iphone).

Testcase

var  win1 = Titanium.UI.createWindow({
                    backgroundColor:'white',
                    title:'Window1'
                });
Ti.App.addEventListener('resume', function(event)  
{  
    alert('resume')
});

win1.open();
1. Create a new mobile project 2. Paste the code in the app.js 3. Install this in an ipad 2 with iOS 4.x 4. Launch the app. 5. Lock the app using the right top hardware button. 6. Unlock it. 7. the alert should appear.

Comments

  1. Sabil Rahim 2012-09-04

    Mauro This is a behavioral change by Apple. Up untill iOS 4.X when the Sleep/Wake Button of iDevice is pressed while the app is in the foreground, it only resulted in the firing of pause event and when returning it would only fire the resumed event subsequently. Apple decided to change this since iOS 5.0 to actually make the app inactive and thus fire both pause and paused when the user hits the sleep/wake button while in foreground. There are many apple forums threads discussing this issue, but Apple seems to have made this intentionally to preserve the battery. Since this is a newly introduced activity in iOS 5.0 , there is nothing that we can do about it. I have made a [doc PR](https://github.com/appcelerator/titanium_mobile/pull/2868) to clearly show what events would be fired and its order.
  2. Sabil Rahim 2012-09-06

    Shak, Just tested with iPhone 4.3,iPad4.3, iPhone 5.0 , iPad 5.1 The ***change*** was **not** device specific, it was between iOS 4.X and 5.0 In iOS 4.X (iphone/iPad) sleep/wake button fires - pause while going to background and resumed when waking up. In iOS 5.0+ (iphone/iPad) sleep/wake button fires- pause followed by paused before becoming inactive and fires resume followed by resumed when waking up.
  3. Lee Morris 2017-03-09

    Closing this ticket as it is not our bug.

JSON Source