简体   繁体   中英

iOS notification when app gets suspended

When the app enters background , I get notification UIApplicationDidEnterBackground . Can I get almost the same notification when app gets suspended ? So the app can work in background because of Bluetooth, because of CLLocationManager and so on, but sometimes it gets suspended. In that case I need to know about that, is there any notification like UIApplicationDidEnterBackground in that case?

The suspended state is not the same as the terminated state. When your app is suspended it is still in memory but it is not currently executing.

Since it isn't executing any code, it isn't possible for you to get a notification when your app is suspended.

Your app is suspended some time after it enters the background; either when you complete any work you start in didEnterBackground or complete any work you start as a result of being called in the background (eg BLE or location delegate invocations).

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