简体   繁体   中英

Will an iPhone app's applicationWillResignActive: method run on incoming call if the phone is already in standby mode?

I understand that if an iPhone app is interrupted (eg, incoming call, user hits the "Sleep" button, etc.) its applicationWillResignActive: method is called. But is this method also called if the phone is already in sleep mode?

For example, if the phone goes into standby due to inactivity (or the user does it manually via the sleep button), the applicationWillResignActive: method is called once. Will it then be called a second time if an incoming call is received while in the sleep state?

No. I finally had some time to come back to this question and do some testing to answer it.

applicationWillResignActive is called when the screen locks (either manually by pushing the button on top of the device or automatically if you have the auto-lock feature enabled). If an incoming call is received while the screen is locked (ie, blacked out), none of the applicationWillX or applicationDidX methods are called on the app delegate.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM