How to restart app if it unexpectedly shutdown

前端 未结 5 2175
梦如初夏
梦如初夏 2020-11-30 02:04

Skype update text contains next:

App auto restarts if unexpectedly shut down

How is possible to perform that via SDK?

5条回答
  •  感动是毒
    2020-11-30 02:45

    Skype does exactly this:

    1. Registers it's TCP sockets for VoIP.
    2. Logs in.
    3. Upon nonzero exit code the app will be relaunched by iOS (Because VoIP applications need to stay running in order to receive incoming calls, the system automatically relaunches the application if it exits with a nonzero exit code.).
    4. It then immediately starts a background task (Relaunched apps remain suspended).
    5. Next it registers it's login socket for VoIP.
    6. It logs back in.

提交回复
热议问题