![]() Now we will start performing ranging of beacons in these regions. Here, we’re using standard UUIDs for Estimote and Kontakt brand beacons, but you can add additional UUIDs or replace these entirely with different ones corresponding to your own beacons.ĥ. We will create some beacon regions to do ranging in. This is what will make the app actually prompt the user to use their location.Ĥ. ![]() We’ll only be doing beacon ranging while the app is in the foreground, so we’re only requesting location permission while we’re using the app and not in the background. If beacon ranging is available, we want to create a new CLLocationManager that we hold onto, and make ourselves the delegate of it.ģ. If it is an older device without Bluetooth LE support or we’re running in the iOS Simulator, beacon ranging will be unavailable.Ģ. First we need to check if beacon ranging is available on our device. Open ist, and add the key NSLocationWhenInUseUsageDescription with String value Required to monitor beacons.ġ. Implementing the beacon ranging app Getting permission for the user’s locationīeacon monitoring and ranging is part of the CoreLocation framework, and access to location services requires permission from the user. It’s handy when as much view and layout-related information can be placed in a storyboard, so the code you’re building can define the logic of the app. The initial UITableViewController that is displayed doesn’t even need a custom class. Most of the app at this point is in the storyboard. ![]() We will fill in the implementations for these methods later on. These classes will contain the respective implementations in Swift and Objective-C to perform beacon ranging. In the project you’ll find two classes: SwiftBeaconListTableViewController and ObjCBeaconListTableViewController. Both go to two other empty UITableViews, so there’s not too much to see yet. Initially we have just a basic UITableView that is displayed with two rows. Open the project in Xcode to start building. The finished product includes both a Swift and Objective-C implementation.Ĭlick here to download the starter project - located on our main site. Developing a beacon ranging applicationīeacon Ranger is a sample app that simply performs beacon ranging on nearby Estimote and Kontaktbeacons (and can easily be modified to range beacons from other manufacturers as well). We can also use the values from several beacons at once to determine which beacons we’re closer to relative to the others. By measuring the RSSI values, we can attempt to estimate the proximity of a beacon to our current location. As a user’s proximity to a beacon increases, the RSSI value will decrease, and as the user gets closer the value will increase. When we setup development for beacon ranging, we want to measure the Received Signal Strength Indicator (RSSI) value, which captures the strength of the signal received. Looking at both languages, we can compare how they fare in accomplishing the same task. In this iOS beacon tutorial, we will explore how to build both a Swift and Objective-C implementation of a beacon ranging app. Used in healthcare settings they could give insight into how industry professionals are spending their time - and where - to identify and reduce any existing inefficiencies. This can give you more accurate positioning than the simple proximity tracking that a single beacon offers and could potentially be used to show a user’s location on an indoor map of a mall or other space. You can also create a network of beacons to simultaneously perform indoor location tracking, where GPS signals don’t penetrate very well. This same approach is even being used to deliver consumers related coupons as they navigate a retail space. As users walk through the space nearing proximate beacons, the send is triggered augmenting the physical experience with the virtual. Or, maybe a museum or art gallery system designed an app leveraging beacon technology to deliver information about the featured artists or exhibit. With that app running for the duration of the time they are in the expo hall, they are delivered information relevant to nearby exhibitors as they approach strategically placed beacons throughout the experience. ![]() Before conference attendees enter an expo or trade show hall, they download an app that uses beacon ranging technology. There are a myriad of opportunities to employ beacon development to learn more about or better engage users. Beacon ranging can be used to convey more than proximity to a given location.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |