I see several methods in appDelegate, and I'm not sure if saving and re-saving user state only in some of them covers all scenarios?
func applicationWillResignActive(application: UIApplication) {
stopTasks()
setSharedPrefrences()
}
func applicationDidEnterBackground(application: UIApplication) {
stopTasks()
setSharedPrefrences()
}
func applicationWillEnterForeground(application: UIApplication) {
startTasks()
getSharedPrefrences()
}
func applicationDidBecomeActive(application: UIApplication) {
startTasks()
getSharedPrefrences()
connectGcmService(application)
}
func applicationWillTerminate(application: UIApplication) {
stopTasks()
setSharedPrefrences()
disconnectGcmService(application)
}
Should only some of them be stored / restored? When should I disconnect and connect to the GCM service?
Is my recovery redundant?
Saving a local flag talking about recovery is not practical, since the application can destroy it?
source
share