Hi, I'm using network extension on my VPN app. I'm override the sleep method and send some data to my server when the method call. I noticed that the server requests are succeeded when I'm connecting with a WiFi networks and failed when I'm connecting with cellular networks. Does the OS blocks immediately the connectivity when I'm on the cellular networks and the device enter to sleep?
I'm override the sleep method and send some data to my server when the method call.
Is this ‘goodbye’ message something that the server ACKs? Or do you just send it and hope?
The pattern that I’d expect to work is:
-
The system calls
-sleepWithCompletionHandler:
. -
You send the goodbye request to the server.
-
You receive the ACK to that.
-
You then call the completion handler passed to you in step 1.
OTOH, consider this:
-
The system calls
-sleepWithCompletionHandler:
. -
You send the goodbye message to the server.
-
You immediately call the completion handler.
Here there’s a race between the goodbye message going out on the ‘wire’ and iOS turning off the application processor.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"