Re: How do I reconnect with App in the background.
Re: How do I reconnect with App in the background.
- Subject: Re: How do I reconnect with App in the background.
- From: András Kövi <email@hidden>
- Date: Tue, 21 Aug 2012 20:30:19 +0200
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 <email@hidden>:
> 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 (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
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