watch OS 2 beacon monitoring and ranging - ios

has anybody found any information about interacting (ranging and monitoring) with Beacons in native Watch OS 2 applications?
I would like to give the user the possibility to range one in an home environment without having the phone in their pocket.
I can't find any docs anywhere and I am wondering if it's actually feasible - and obviously if there is any kind of example around.
Thanks

Core Location on watchOS is stripped of all the iBeacon functionality. There are no startRangingBeaconsInRegion: and startMonitoringForRegion: methods, as can be seen in the CLLocationManager reference documentation:
https://developer.apple.com/library/watchos/documentation/CoreLocation/Reference/CLLocationManager_Class/
The only option for now is to do the ranging/monitoring on the iPhone, and pass the results to the Watch app via the Watch Connectivity Framework.
UPDATE for watchOS 4: still no iBeacon in Core Location, but there's now Core Bluetooth available for the watchOS apps, which means your app can detect non-iBeacon packets, such as Eddystone, or Estimote's Nearable/Telemetry.
Only if your app is in the foreground or has execution time though. The latter meaning that, for example, if your app is already running in the background because you're using the new "location updates" background mode for turn-by-turn navigation, or you're tracking workouts in the background, then you can at the same time scan for beacons. In and on itself, detecting Bluetooth beacons won't keep your app alive in the background, it will get suspended.

directly use watch to monitor/ranging with watchOS is prohibited by Apple (it detailed in developer document). It mean you can not turn bluetooth on watch and start monitoring directly! But there're another way, you can integrate app with watchOS, I gave a tried before with our app and it work pretty good. We're using Estimote, you can refer right here: Estimote Watch SDK Integration
It can be transport notification from iOS device to watch. They provide several helpers support that. Good luck!

Related

is it possible to run Scan Beacon when app is Killed

Hello I'm new developer so i need some help Now. I was Bullied app doing Brodcast and Scan Beacon i used flutter_beacon 0.3.0
and for Brodcast i use beacon_broadcast 0.2.1 its working good for Advertising and Scan event when app is Background,but when app is kill or i remove app from list Running applications the Scan and Brodcast not Working
Now My Question is How to running code scan and Brodcast when app is killed or Finished ???
Yes, it is absolutely possible to resume beacon scanning on both Android and iOS after an app is killed. But the specifics of how you do this are different between iOS and Android. Further, the use of non-native development frameworks like FlutterBeacon make things more complicated as the documentation is not as complete for this use case.
While I am not an expert on FlutterBeacon, I am the lead developer on the underlying Android Beacon Library which it uses under the hood. I am also very familiar with how iOS CoreLocation works (which it also uses under the hood.)
In general here are the rules to get apps to detect after being killed:
iOS:
Start beacon monitoring (not just ranging) in the didFinishLaunching method of the AppDelegate
Obtain ALWAYS Location permission
After the app is killed it will be re-launched in the background when all beacons disappear or the first beacon appears in a monitored region.
Android:
Start beacon monitoring in the onCreate method of an Android application class using RegionBootstrap. See here for a discussion on the FlutterBeacon github
Obtain BACKGROUND_LOCATION permission from the user.
On Android 8+, your app should restart within 25 minutes of being killed and give you a callback to the BootstrapNotifier methods as appropriate.

Change iBeacon UUID (or Major/Minor) with Custom iOS App?

Has anyone had success with configuring non-name brand iBeacons (eg. https://www.ebay.com/itm/NRF51822-2V-3-3V-bluetooth-4-0-wireless-module-for-ibeacon-base-stat-JF/254232206096?hash=item3b316b9b10:g:TT4AAOSwaMtcnXbr) with an iOS app?
I have an app running that can scan for these beacons just fine, but my target application involves modification of the beacon UUID which (as far as I understand) is fairly contingent on the SDK provided by the maker of the beacon. Things like Estimote are pretty clear about their SDK capabilities but the beacons are a bit too expensive and bulky.
Open to literally any input or recommendations, I'm hitting a wall here.
Thanks.
The provider of the beacons should have a configuration app available. Avoid providers without such an app.
Even though iBeacon is exactly specified, configuring such beacons is not, so apps are not interchangeable.
I've used Wellcore beacons successfully, that are quite competitive on price when ordered directly from China. I made a free configuration app for them, based on their SDK, as there was no such app in English: https://play.google.com/store/apps/details?id=com.abiro.cliqtagsbeaconwriter
I got bad reviews as Wellcore changed chipset without telling me, so the app stopped working, but that's fixed.

Is it possible to beacon with iOS in a background service?

Based on this documentation I understand that iOS devices can function as bluetooth beacons.
The documentation states that apps must be in the foreground for the beacon to work.
We need the beaconing to work when the app is not in the foreground. Could we solve this by using a service (similar to Android)?
Sorry, but you simply cannot transmit standard beacon formats like iBeacon, AltBeacon or Eddystone when an app is in the background on iOS.
Apple prohibits this because there is limited ability to advertise on bluetooth, and not all apps would be able to do this at the same time. Instead, Apple uses a proprietary technique that allows background apps to advertise Bluetooth services in the background. This proprietary technique is not compatible with the above bluetooth beacon transmission formats.
That said, a creative project has found a way to harness Apple's proprietary background advertising technique to allow you to use a custom beacon advertising format that does work in the background on iOS. The main disadvantage is that support is limited to receiving the advertisement on other iOS devices.
The project that lets you do this is also called AltBeacon (but should not be confused with the open source AltBeacon format described above) You can read more about it here: https://github.com/Decemberlabs/AltBeacon

CoreBluetooth advertising in background on iOS 10

First: I have an iPad Air 2, and an iPhone 7. For further reading we estimate that the app is active and open on iPad and in background mode on iPhone. The app is exactly the same, even with same Bluetooth Service UUIDs and same DataLocalNameKey.
I want to write an app that can advertise a bluetooth service in background and is able to discover this service (optimal in background too). As I already read I can't use apples beacon technology cause there it's only possible to get scanning/notified by beacons in near in background (I tested this, works fine) but not to advertise. So I started to use CoreBluetooth as described in the mentioned SO answer cause there it's possible to advertise in background.
My app calls didDiscoverPeripheral method in CBCentralManagerDelegate on the iPhone (app in background), so it detected the iPad. The isAdvertising property of CBPeripheralManager on iPhone is true. But didDiscoverPeripheral is not called on iPad. I'm a little bit confused. One option is my iPad is not able to detect the iPhone anymore for some reasons or my iPhone is lying and it's not advertising.
So i thought I'm just a little bit of dumb and googled for "CoreBluetooth debug apps". I found Vicinity and AltBeacon. And with both apps the behavior is the same! If you background (press home/sleep button) the advertising app, the browsing app is not able to discover it anymore. If you open the backgrounded the app it will instant discover it. Both apps mention that its possible with them to broadcast in background.
Am I doing something wrong; is this behavior expected? Did I misunderstood the framework? Can you confirm this behavior?
To confirm this, the fastest way is to install Vicinity on two devices (you have to add the NSBluetoothPeripheralUsageDescription key to Info.plist) set one device to broadcast and press the home button.
This isn't anything specific to iOS 10 -- it's always been this way on iOS. On iOS, apps simply cannot send out standard Bluetooth LE advertisements when they are in the background. They have to be in the foreground to do this.
That said, there is limited support in iOS for apps advertising GATT Services in the background. This uses a proprietary technique that only works with other iOS devices that are looking for those services. (Because it uses a non-standard proprietary scheme, the same technique won't work for beacon advertisements, for example.)
Here's how Apple describes it:
...you should be aware that advertising while your app is in the background operates differently than when your app is in the foreground. In particular, when your app is advertising while in the background:
The CBAdvertisementDataLocalNameKey advertisement key is ignored, and the local name of peripheral is not advertised.
All service UUIDs contained in the value of the CBAdvertisementDataServiceUUIDsKey advertisement key are placed in a special “overflow” area; they can be discovered only by an iOS device that is explicitly scanning for them.
If all apps that are advertising are in the background, the frequency at which your peripheral device sends advertising packets may decrease.
Read more here: https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html
it was a bug in ios 10.0.(1) and partially fixed in ios 10.1
src: https://forums.developer.apple.com/thread/51309

iBeacon transmission when app is closed?

We would like to use some configuration of the iBeacon , where the user's iPhone will advertise its services, but when the app is closed.
So when a user come across a hardware beacon, it will recognise the user's iPhone(as a beacon) without opening the app, and even connect to it .
I could find here many opinions about that, but i wonder if there are any news with the iOS8 ,and if there is a clear answer for that from Apple ?
A couple of points:
Bluetooth beacons, iBeacons included, are transmit only. They don't see or "recognize" other beacons or phones. The statement "when a user come across a hardware beacon, it will recognise the user's iPhone(as a beacon)" is not possible with the technology regardless of whether the app on the phone is in the foreground or the background.
iBeacons are supported on iOS devices with version 7.x and 8.x of the operating system. On all these versions, however, beacon transmission from the iOS device is only supported when the app is in the foreground. See here for details.

Resources