Post

Replies

Boosts

Views

Activity

Reply to I want to close my app after a while in background mode
Thank you for your kindly explanation. I understand what options I have. The few minutes iOS provide for background task is not good for me. I understood that it causes ugly user experience when my user comes back to my app just after doing something in other apps for few minutes if I apply the terminating my app in background task. OK, I choose a direction that I do refactoring my startup codes to reduce and optimize enough to running it on every bringing up to foreground. Thank you for your advice again.
Jul ’23
Reply to I want to close my app after a while in background mode
Thank you eskimo for your reply. My app communicates my server through http(s). We know that http(s) is connectionless basically. So, My server removes a session for my app after 30 minutes if there is no communications between them. But, my app can not recognize the lost of the session if it sleeps in background. That makes some unpredictable situation. My app in background even can not send alive ping message to my server to maintain the session because it sleeps deeply in background mode in iOS. I think there is a workaround that my app restarts business logic when it is brought up foreground. But my app needs some complicated sequence for startup. I cannot handle a situation if a user send my app to back/foreground quickly many times in few seconds if I apply that workaround. The best simple way is to request iOS that 'please terminate my app if a user does not bring it foreground within 30 minutes'. Or, terminate it myself.
Jul ’23