Background timer for session logout

As the os provides only about 30 sec with
Code Block
func beginBackgroundTask(expirationHandler handler: (() -> Void)? = nil) -> UIBackgroundTaskIdentifier
after which the app is suspended.

Is there a way to run the timer in background for 3 minutes to logout from the server session? or is there any other possible approach to get an event after 3 minutes to perform logout while the app is in background?
Thanks for creating a new thread for this.

So, to start, why does your server take so long to log out? Most servers I’ve used can log out with a single HTTP POST, whose duration is usually measured in tenths of a second rather than tens of seconds. What are you doing during this logout sequence that makes it so slow?

Also, is this an HTTP server? Or does it use some other protocol?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
I wish to initiate the log out sequence (taking tenths of a second) after some time interval when the app goes in the background.

This is to make sure the user does not have to enter the passcode every time after the app is brought to foreground after short time interval (less than 3 minutes).

Earlier, the OS provided approximately 3 minutes before the expiration handler was called which made this feasible.

Background timer for session logout
 
 
Q