strange behavior when App Lifecycle Events on an iPhone 15 Pro Max when turning off the screen using the side button in iOS 17.5.1

Hello fellow iOS developers!

Using a simple app with only print lines in the SceneDelegate class, all other tested devices running iOS 17.5.1 (iPad Pro M4, iPad Pro 3rd Generation, iPhone XR) exhibit this behavior when turning off the screen using the side button:

2024-05-31 21:21:13.0260 --sceneWillResignActive 
2024-05-31 21:21:13.0290 --sceneDidEnterBackground 

This is the same as when putting the app in the background.

However, the iPhone 15 Pro Max running iOS 17.5.1 does this:

2024-05-31 9:08:28.4580 PM --sceneWillResignActive 
2024-05-31 9:08:29.8310 PM --sceneDidBecomeActive
2024-05-31 9:08:29.8490 PM --sceneWillResignActive 
2024-05-31 9:08:29.8510 PM --sceneDidEnterBackground

I’ve also submitted this as a potential bug in the Feedback Assistant. Does anyone know why sceneDidBecomeActive() is invoked when turning off the screen with the side button in this specific case?

I’m aware that using Face ID causes the app to briefly experience sceneDidBecomeActive() followed by sceneWillResignActive() during biometric authentication, and then switches back to sceneDidBecomeActive() once authentication completes. But why does this odd behavior occur when turning the screen off in simple app?

Is there a way to detect that the side button has been pressed to turn off the screen?

Thank you in advance,

--SalCat

I'd like to know the answer to this...

strange behavior when App Lifecycle Events on an iPhone 15 Pro Max when turning off the screen using the side button in iOS 17.5.1
 
 
Q