Re: How do I reconnect with App in the background.
Hi Joakim, I filed a bug a few days ago (#12120727). I'd be grateful if we could clarify the situation fast as this issue may directly influence any apps that intend to transfer data in the background. Thanks, Andras 2012/8/21 Joakim Linde <joakim@apple.com>:
Hi Jim,
Andras is correct, Core Bluetooth will try to connect to the device while the app is in the background or the screen is off.
Andras, please file a bug report at bugreport.apple.com with your issue and we'll take a look at it.
Thanks, Joakim
On Aug 21, 2012, at 11:30 AM, András Kövi wrote:
Hi Jim,
if you issue a connectPeripheral call in the didDisconnectPeripheral callback, the phone will reconnect to the device as soon as it becomes reachable again. You have nothing else to do, this is happening automatically. If in 2 seconds, then in 2 seconds, if 3 months, then 3 months. The framework will invoke the didConnect callback when it happens. I tried this.
But note that this reconnect may take longer than when the app is in the foreground. For some reason, backgrounded scanning is 55 times slower than in the foreground and I suspect something similar is affecting the connection times too.
My issue, however, is that the peripheral attribute write requests are somehow not delivered to the app in background. Could you tell me what mechanism do you use to communicate with the device when in the background?
Thanks, Andras
2012/8/21 Jim Gamache <jamespgamache@gmail.com>:
Joakim, I am designing a medical device which is being worn and using the Iphone as a gateway. When my app is in the background, and the user moves out of range, I get the didDisconnectPeripheral event, and this will reconnect if the device is back in range. However, without a timer running I don’t know how to keep retrying to reconnect. It could be hours later. I tried having my device send notifications, but once disconnected, the iphone doesn’t receive these. It is not acceptable to make the user hit a button on the phone to reconnect.
Thanks
_______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/allprog%40gmail.com
This email sent to allprog@gmail.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/joakim%40apple.com
This email sent to joakim@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
András Kövi