iBeacon - iOS Region Monitoring and Region Advertising simultaneously - iphone

I am trying to use
[self.peripheralManager startAdvertising:self.myBeaconData];
to advertise UUID and beacon’s identifying information and also monitoring same UUID with different minor and major using
[self.locationManager startMonitoringForRegion:self.myBeaconRegion];
but I am not able to fulfill this requirement of using same Device(iPhone) as receiver as well as broadcaster(advertiser)
Can anyone help me to create a iPhone Device to behave as a Broadcaster(Advertise an UUID, for example "A77A1B68-49A7-4DBF-914C-760D07FBB87B") and at same time behave as Receiver to Monitor same region for other beacon having same UUID "A77A1B68-49A7-4DBF-914C-760D07FBB87B".

Currently you cannot broadcast an iBeacon and simultaneously monitor for iBeacons. This is current as of iOS 7 and iOS 8 Beta 4. This is not likely to change any time soon. This is also why all tutorials show 2 apps and 2 devices usually.

Related

Determine distance between two devices

I have a question about Core bluetooth in swift language,
Is this framework can determine the distance by meter between two devices ?
And it have working on background?
Thank you
Not normally, but features like this are being added as part of the new contact tracing API
https://www.apple.com/covid19/contacttracing
Before that, device to device Bluetooth could not be in the background.
Note: you will not be able to use this API unless you have a legitimate health app backed by a government or established health organization.

iOS 9.2.1: iBeacon region monitoring bug

I deployed the same iBeacon region monitoring code in 7 devices. One of them, iPhone 6 running iOS 9.2.1, is regularly failing to detect beacon states (inside, outside, etc..).
I tried with and without SIM card and when the SIM card is inserted it gives better results. However, when compared to an iPhone 6 running iOS 9.2.3 and one running iOS 9.2.1 it gives worst results (the latter two iPhone's always detect the region).
Have you experienced the same in this version of iOS (iOS 9.2.1)?
Is this an known official Apple bug?
My theory behind this:
iBeacon region monitoring uses iPhone location, iPhone location can be
improved using Wi-Fi and phone signal and possibly also accelerometer
and gyroscope data.
iOS could be using these in combination withe the Bluetooth data to
"tune" the beacon ranging thread (in other words if a significant
location happens then the background monitoring frequency will be
increased). Hence if this tuning is depending on the SIM card
information there could be a version of iOS where they put a stronger
dependency on the SIM card presence leading to what I am observing.

iBeacon, Is possible to get list of BLE devices?

I have bought 5 BLEs from sensor tag, I Downloaded some iBeacon detection code.
But I do not know UUID of the 5 BLEs. Do I Need to put the UUID in my iBeacon detection code?
How Can I get the bluetooth device list using iBeacon code?
While you can use CoreBluetooth to do an LE scan and see all nearby iBeacons, the info you get back about each iBeacon is not very useful -- iOS blocks you from being able to read the iBeacon identifiers, including the ProximityUUID. See My blog post about this here.
So the bottom line is that while you can see unknown Proximity UUID iBeacon devices with iOS, you cannot even be sure the devices you see are iBeacons at all.
Android and OSX Mavericks do not have this restriction, so if you have access to one of those devices, try my company's iBeacon Locate or ScanBeacon products, which will read your identifiers for you.
Is impossible, at lest no way to get this list via public API, you must know the UUIDs before ranging

iBeacon: Is possible send small data to track from transmit?

I am going to start a project code for iBeacon with iOS 7 and bluetooth 4.0.
http://www.appcoda.com/ios7-programming-ibeacons-tutorial/
Readied above link, i have coded it and tested . it is working fine .
Created two apps. One for transmit beacon and another for track beacon.
How can send small data to track beacon from transmit beacon. Small data is a ID of room.
Is possible send small data to track from transmit?
You cannot send any other data from a device transmitting as a beacon to another device via the iBeacons protocol. However, if only want to know a room ID, then you should set this as either the major or minor value of the beacon (or a combination of those two values).
As an example, a large retailer might set:
UUID: A single UUID for the retailer
Major ID: Identifies the specific store that a beacon is located in
Minor ID: Identifies the department that the beacon is in
If you wish to transmit more substantial data between two iOS devices, you'll probably want to look at something like Apple's Multipeer Connectivity framework.
https://github.com/DavidSahakyan/LGBluetooth
here is a framework which will help you to work bluetooth 4

CoreBluetooth - iPhone advertising in background mode

I am working on an iPhone and Mac OS X application, which allows you to lock and unlock your Mac via proximity. Means if you the signal strength is under a determined threshold or the connection gets lost it shall lock the mac.
I am working with Apples CoreBluetooth framework for BTLE, using the iPhone as a peripheral and the Mac as a central. So far so good. It also works very well but when I send the app to the background on the iPhone the advertising seems to change. The iPhone still advertises but without the service profile and characteristics, I use in the app.
Although this is not a problem when the iPhone is still in the range of the Mac, because it's still connected and the characteristics are not used in the central, it becomes a problem after moving the iPhone out of the range. As expected the Mac locks and starts discovering to reconnect the iPhone and unlock if succeeded.
But in this discovery, I use the specified service profile and the characteristics to only get devices running my app and to identify the one for unlocking.
I tried a workaround by discovering without a service profile and identifying the correct device via its UUID, which I saved when I started to use this iPhone for locking and unlocking. This workaround also works in a small scope, because when I turn off the Bluetooth on the iPhone and turn it on again, it gets another UUID. That's a constraint I could live with, but it also changes the UUID after a few hours and then the unlocking does not work.
Maybe someone already worked on an app like that and know how to fix such a problem? Or you know a static value which I can use to identify the device?
So it seems, like usual, Apple has some weird and unique things going on in their framework. When you advertise from an iOS device (such as your iPhone), there are two "storage areas" for the advertisements -- a normal one that any device that is scanning can see, and an "overflow" one that can only be seen by iOS devices that are specifically scanning for it. When your app advertises in the background, all services UUIDs that you advertise go into this overflow area unfortunately, so it looks like only other iOS devices can see it -- and not your Mac. From the CBPeripheralManager docs:
Any service universally unique identifiers (UUIDs) contained in the
value of the CBAdvertisementDataServiceUUIDsKey key that do not fit in
the allotted space are added to a special “overflow” area; they can be
discovered only by an iOS device that is explicitly scanning for them.
While your app is in the background, the local name is not advertised
and all service UUIDs are placed in the overflow area.