applicationWillResignActive method not triggering API call as expected

I'm currently working on an iOS app where I need to trigger an API call as soon as applicationWillResignActive is called. The method is designed to save user data and sync certain settings before the app transitions to the background. However, I'm experiencing issues where the API call is not consistently being triggered within this method.

Does applicationWillResignActive not fully warrant an api call?

I’m presuming that “API call” refers to some sort of networking operation.

If so, it’s likely that your app is being suspended before the network operation completes. This is the canonical use case for a UIApplication background task. See UIApplication Background Task Notes for links to documentation and lots of extra info.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

applicationWillResignActive method not triggering API call as expected
 
 
Q