Friday 15 August 2014

ios - CoreBluetooth - iPhone advertising in backgrund mode -


I am working on an iPhone and Mac OS X application, so you can lock and unknow your Mac. This means that if you have the strength of the signal below a specified limit or the connection is lost then Mac will have to be locked.

I am working with the Apple CoreBluetooth Framework for the Beetle, using the iPhone as a peripheral and Mac as a central one. So far, so good. It works great, but when I send an app to the background on the iPhone, the ad changes. IPhones are still advertised but without service profiles and features that I use in the app. Although this is not a problem, when the iPhone is still in the Mac's limit, because it is still connected and it is not used in the central, it becomes a problem after the iPhone is taken out of the border. As expected from Mac Lock and the iPhone starts to search for connecting and unlocking.

But in this quest I use specific service profiles and attributes to get devices that only run my app and unlock one.

I tried an alternative solution by searching without a service profile and identified the correct device through the UUID, which I saved, when I started using this iPhone to lock and unlock This solution works even in a small scope, because when I turn off Bluetooth on the iPhone and turn it on again, it becomes another UUID. There is an obstacle with which I can live, but it also changes the UUID after a few hours and then does not work by unlocking.

Perhaps someone has already worked on this kind of app and knows how to fix this kind of problem? Or do you know a stable value that I can use to identify the device?

It seems, like normal, there are some weird and unique things in the apple that move in their framework Have been there. When you advertise with an iOS device (such as your iPhone), there are two "storage areas" for advertising - a common one that can see any device with scanning, and "overflow" that only seen by IOS devices that are specifically scanning for when your app advertises in the background, all the services UUID which you advertise, unfortunately, this overpriced Week are in the field, it seems that can only other iOS device - and not your Mac. From:

Any service contained in the value of CBAdvertisementDataServiceUUIDs is not a universal unique identifier (UUID) that does not fit in the allocated space, is added to a specific "overflow" ?? ?? Area; They can only search for an iOS device that is clearly scanning for them. Although your app is in the background, the local name is not advertised and all service UUIDs are kept in the overflow area.

No comments:

Post a Comment