Unexpected lifecycle callback sequence when pressing the top button to put iPad to sleep on iPadOS 27 beta

Hello,

I found a difference in application lifecycle behavior between iPadOS 26.5 and iPadOS 27 beta when the app is running in the foreground and the iPad top button is pressed to put the device into sleep.

Test condition

  • Device: iPad
  • App state: app is running in foreground (active)
  • Action: press the top button once to put the device to sleep
  • Observed via UIApplicationDelegate lifecycle callbacks

Observed behavior

iPadOS 26.5

The following callbacks are called in this order:

  1. applicationWillResignActive
  2. applicationDidEnterBackground

iPadOS 27 beta

The following callbacks are called in this order:

  1. applicationWillResignActive
  2. applicationDidBecomeActive
  3. applicationWillResignActive
  4. applicationDidEnterBackground

Expected behavior

I expected the lifecycle sequence on iPadOS 27 beta to be the same as, or at least consistent with, iPadOS 26.5 when the device is put to sleep from the foreground app state.

In particular, I did not expect applicationDidBecomeActive to be called during the transition to sleep/background.

Question

Is this changed behavior expected in iPadOS 27 beta, or could this be a bug in the beta?

If this is expected, could you clarify the intended lifecycle behavior when the top button is pressed and the device transitions to sleep?

Thank you.

Answered by DTS Engineer in 902180022

Hello @minkhantluu,

Rest assured, the scene lifecycle and the application lifecycle have not been changed in iOS 27.

This specific glitch appears to have been caused by some internal system activity that causes the scene to momentarily become active, which in turn causes the application state to also become active.

If anyone would like to track the fix for this, please file a bug report via Feedback Assistant, and post its FB number to this thread.

Hoping this helps,

Richard Yeh  Developer Technical Support

This is also happening on iOS 27 Beta as well.

It is happening on iOS 27 beta as well. I have tried with scenePhase just to make sure it is UIKit issue or not. but scenePhase.active is being called when I try to lock the screen.

Hello all,

Application lifecycle is a consequence of the scene lifecycle. As such, the presence of applicationDidBecomeActive callbacks (as well as scenePhase set to .active) might be caused by a scene getting activated before all scenes are deactivated, and then backgrounded. So this is expected behavior, as long as no phases are skipped.

Hoping this helps,

Richard Yeh  Developer Technical Support

Thanks @DTS Engineer but wondering why it (27 beta) doesn't behave the same with 26.5 and lower version ?

For 26.5 or lower version. that applicationDidBecomeActive or scenePhase .active is never being called when the user lock the screen.

Hello @minkhantluu,

Rest assured, the scene lifecycle and the application lifecycle have not been changed in iOS 27.

This specific glitch appears to have been caused by some internal system activity that causes the scene to momentarily become active, which in turn causes the application state to also become active.

If anyone would like to track the fix for this, please file a bug report via Feedback Assistant, and post its FB number to this thread.

Hoping this helps,

Richard Yeh  Developer Technical Support

I have submitted this issue to Feedback Assistant. The feedback number is "FB24423679".

I have reported as well. The feedback number is 24425002

Unexpected lifecycle callback sequence when pressing the top button to put iPad to sleep on iPadOS 27 beta
 
 
Q