I noticed that as soon as I exit the bluz ios app my connection to the bluz module is dropped and I must manually open the bluz app and connect before I can go to the particle ios app and use tinker to toggle pins and such. Is there a way to auto connect to my bluz when I am in range, much like my bluetooth headphones would?
When you say “exit the app”, do you mean hit the Home button? Or double tap home and swipe up (as in kill the app)?
If the app is left running in the background (hit home), then bluz should stay connected. If you go out of range where bluz disconnects and then come back in, then bluz won’t auto-reconnect.
However, there is a setting that should allow auto-reconnects. If you go to iOS Settings and then scroll down to bluz, there is an option you can check which will make bluz auto-reconnect when it is back in range. This is a bit experimental, but it does work ok and if you wanted to try it we would love any feedback!
Thanks @eric I will give that a try tomorrow. I was actually talking about killing the app, it did appear to maintain connection while in the background after I had connected previously. But as you said earlier, anytime disconnection happened by going out of range, or the app was killed, before I was able to use the particle tinker app again I would have to first launch bluz and reconnect, which seemed odd as my other bluetooth devices will auto reconnect. I will give this setting a whirl.
Hi @eric I am on iOS 10, iphone6s, and inside settings I have set Bluz to auto reconnect, however, it does not seem to have any effect. Here are the steps I take:
- Turn on auto reconnect inside settings.
- Launch Bluz app.
- Connect to Bluz device.
- Hard exit the Bluz app.
- Relaunch the bluz app.
- App will never reconnect to the Bluz device.
This is a pretty important feature for us, we’d like not to have to tell users to reconnect to their device every time they launched our app.
Are you trying to write your own app?
We use the standard Core Bluetooth framework as part of the iOS SDK, so anything you can do with that you can do in your own app. I know it is possible to scan/connect to devices while in the background mode. You can view the iOS documentation for more details: https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4
Alternatively, you could scan/connect when the app is opened. Our standard app doesn’t handle all of these cases as they weren’t standard use cases for us (for example, we always wanted a user to select the device to connect to and not have it happen automatically). So you can certainly configure your app to do whatever you would like.