State Preservation and Restoration Because state preservation and restoration is built in to Core Bluetooth, your app can opt in to this feature to ask th
Just figured this out recently with the help of Apple Tech. Also given/have a nice link that shows the different ways to cause the app to restart without user intervention.
I did it by causing the app to crash suddenly with the following snippet of swift code. This causes the app to restart and the call the 'willRestoreState' callback.
DispatchQueue.main.asyncAfter(deadline: .now() + 5)
{
print("Killing app")
// CRASH
if ([0][1] == 1){
exit(0)
}
exit(1)
}