I don't believe there is a way around it in afraid. Just like when your app is first installed, it won't do anything until the user first launched it.
Sent from my iPhone Thanks Darren, that allowed me to test the system killing it, so my App continues to work in that case.
Just hoping to figure out a way around the ‘user kills it’ case now.
NickM: +44 (0)7986 048 141
Would it be possible to scan for devices instead, so if the user kills the App and the device disconnects then it would be picked up advertising again and start the App in the background? I don’t really want to do this, because it will run down the battery by scanning unnecessarily, but I would like to ensure the App is always connected to the device if possible.
Is there a way to simulate the App being killed in the background by the system?
Thanks
Hi Nick,
if your app is killed by the user, then you are done. There is nothing to prevent or act upon it.
If your app is killed by the system, then state restoration should do its job, given you set up the connectPeripheral:options: options correctly. Please look up the related documentation and tons of StackOverflow Qs.
To keep your app connected, you should issue connectPeripheral with the same parameters as previously, as soon as you receive the disconnected callback.
Thanks, Andras
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|