Andrew
Andrew

Reputation: 9

BLE Beacon Functionality in iOS7

I want to know if Beacons can launch a simple URL in iOS7 devices when they come into a predefined range of the Beacon or do they need a specially designed BLE enabled application sitting on the phone to do this other than a browser like Safari, Chrome, etc.

Basically I want to understand if BLE and Beacons can act in a similar scenario to tapping a phone on an NFC tag ie user taps NFC device on NFC tag and a simple URL is launched which is loaded in the users default browser.

Appreciate the assistance.

Upvotes: 0

Views: 1069

Answers (3)

Garett
Garett

Reputation: 562

Unfortunately, you cannot do what you are looking to accomplish.

You MUST have your OWN app on a device to detect iBeacon, and trigger an action

If you did have an app on a device, you can do anything you like when you come in range, or leave the range of a known iBeacon.

Upvotes: 2

davidgyoung
davidgyoung

Reputation: 64916

Yes, this can work.

An iOS app can launch a URL in Safari with:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.google.com"]];

As for making the app do this when a Phone taps on an iBeacon, this is possible with some caveats. You would have to combine both the iBeacon monitoring and ranging APIs like this:

  1. The monitoring API would be used to launch the app into the background when an iBeacon is first seen. The app would then bring itself to the foreground and start ranging.
  2. Once ranging says the iBeacon is in "immediate" proximity (about half a meter away), the app would execute the code above to launch Safari with a specific URL.

One caveat is that this solution means the app has to be displaying something in the foreground from the time that your phone first sees the iBeacon (about 100 feet away) and when it is in close enough range for you to launch the URL in Safari. I suppose you could simply show instructions like "tap the nearby iBeacon".

Another caveat is that if the user sends the app to the background during ranging, the app won't be able to perform this functionality again until the user goes out of range of the iBeacon and comes back in range. Otherwise the app will remain suspended.

Upvotes: 1

Khaled Barazi
Khaled Barazi

Reputation: 8741

It would be the application (yours) recognizing that it has come within range of a predefined beacon and then (your app) would launch a UIWebView - still within your app - with a predetermined URL.

Hope this helps.

Upvotes: 0

Related Questions