在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Estimote/iOS-Indoor-SDK开源软件地址:https://github.com/Estimote/iOS-Indoor-SDK开源编程语言:Objective-C 98.5%开源软件介绍:Estimote Indoor Location SDKEstimote Indoor Location SDK allows real-time beacon-based mapping and indoor location. We know that building the next generation of context-aware mobile apps requires more than just iBeacon™ hardware. That's why we've built smarter software that abstracts away the difficulty of understanding proximity and position within a given space. Estimote Indoor Location is a sophisticated software solution that makes it incredibly easy and quick to map any location. Once done, you can use our SDK to visualize your approximate position within that space in real-time, in your own app. Indoor Location creates a rich canvas upon which to build powerful new mobile experiences, from in-venue analytics and proximity marketing to frictionless payments and personalized shopping. Estimote Indoor Location works exclusively with Estimote Beacons. Learn more:
Table of ContentsHow does Indoor Location work?Indoor Location SDK enables creating location through builder and obtaining position updates from the location. Besides location builder there is also possibility of mapping location through Estimote Indoor Location App. The mapping process is simple. First, you'll need to map the shape. Start by walking around a location and stick as close to the perimeter as possible. Remember to hold the phone in front of you for the location to be mapped properly. The app will now suggest the number and placement of beacons. Affix them on the walls at chest height. To finalize the process walk around the location once more (again with the phone in front of you). Stop at each beacon along the way, to complete this one-time configuration process. There is a nice video tutorial by @phillydev716 on YouTube on how to use Indoor Location in your app. Please note, that video tutorial uses older version of our SDK (v.1.6). InstallationSDK is available as
Alternatively you can add SDK manually:
Key conceptsNote that Estimote Indoor Location uses Cartesian coordinate system, which is different than iOS coordinate system. Location represents a physical location. It is a simple polygon constructed out of points. Location has a property orientation which denotes angle between magnetic north and vector On a location’s boundary segments can be placed doors, windows which are called linear objects. UsageSetting up a new locationThere are two ways of setting up a new location. You can use for this purpose Manually, using EILLocationBuilderYou have the option to create an In order to construct a new location you need to:
The shape of the location is defined by its boundary points. For example, consider a square defined by points (0,0), (0,5), (5,5), (5,0) along with its orientation with respect to magnetic north. EILLocationBuilder *locationBuilder = [EILLocationBuilder new];
[locationBuilder setLocationBoundaryPoints:@[
[EILPoint pointWithX:0 y:0],
[EILPoint pointWithX:0 y:5],
[EILPoint pointWithX:5 y:5],
[EILPoint pointWithX:5 y:0]]];
[locationBuilder setLocationOrientation:0]; Points that define the shape of location also define its boundary segments. They are indexed in the same order as the points. In this example there would be the following 4 segments: [(0,0), (0,5)], [(0,5), (5,5)], [(5,5), (5,0)], [(5,0), (0,0)]. The next step is to place beacons and doors in the location: [locationBuilder addBeaconIdentifiedByIdentifier:@"aabbccddeeff"
atBoundarySegmentIndex:0
inDistance:2
fromSide:EILLocationBuilderLeftSide]; Using Note that methods used for adding beacons that are identified by their mac addresses are now depracated. Please use methods using identification by identifier instead. Via Estimote Indoor Location AppUsing Estimote App the procedure consists of the following steps:
If you mapped a location it was automatically uploaded to your Estimote Cloud account. You can fetch it from Estimote Cloud in your own app (see section: Managing locations in the cloud). Obtaining position update inside the locationOnce you have instance of Monitoring location is simply determining if the user is currently inside or outside the location. In order to monitor location, first you need to create instance of EILIndoorLocationManager *indoorLocationManager = [EILIndoorLocationManager new];
[indoorLocationManager startMonitoringForLocation:yourLocation]; To obtain position updates, you need to set a indoorLocationManager.delegate = yourDelegate;
[indoorLocationManager startPositionUpdatesForLocation:yourLocation]; In addition to position, updates provide also information about accuracy of determined position which can be visualized via EILPositionView or EILPositionNode as avatar with a circle of given radius within which the real position is expected to be. Note, that you need only one Indoor Location Manager to monitor multiple locations. However, position updates are available for only one location at the same time. If you need to enable position updates for new location, first you need to stop position updates: [indoorLocationManager stopPositionUpdates]; In order to have Indoor Location status change and position updates without delay, you should start Indoor Location Manager and monitioring for Indoor Location early. EILIndoorLocationManager position updates can be delivered in three different modes.
In order to change mode simply change indoorLocationManager.mode = EILIndoorLocationManagerModeNormal; If the position updates delivery is in progress it will effectively restart position updates with new mode. Obtaining position updates in backgroundIf you want your Indoor Location enabled app to also work, when the app is running in the background, you have to use EILBackgroundIndoorLocationManager *backgroundIndoorLocationManager = [EILBackgroundIndoorLocationManager new];
self.backgroundIndoorLocationManager = backgroundIndoorLocationManager; In order to work properly your app needs access to bluetooth also when it is in background. To set that you need to go to the project settings, find "Capabilities" tab, set "Background modes" to On and check "Uses Bluetooth LE accessories". In order to relaunch the application (if it is killed by operating system or user) as the user enters the location "Always in use" Location Services authorization is required: [self.backgroundIndoorLocationManager requestAlwaysAuthorization]; For best UX patterns for requesting permission please refer to the following blog post. Also you need to go to the project settings, find "Capabilities" tab, set "Background modes" to On and check "Uses Bluetooth LE accessories". To obtain position updates, you need to set a backgroundIndoorLocationManager.delegate = yourDelegate;
[backgroundIndoorLocationManager startPositionUpdatesForLocation:yourLocation]; To stop updating position: [backgroundIndoorLocationManager stopPositionUpdates]; Important notes:
Managing locations in the Estimote CloudTo manage your locations, you can use requests that allows communication with Estimote Cloud. Provided requests are as follows:
Each location saved in Estimote Cloud is given a unique string identifier that corresponds to the EILRequestFetchLocation *request = [[EILRequestFetchLocation alloc] initWithLocationIdentifier:yourLocationIdentifier];
[request sendRequestWithCompletion:^(EILLocation *location, NSError *error) {
if (!error)
{
self.myLocation = location;
}
}];
Please note that in order to have these methods working you need to be authenticated in Estimote Cloud. To do that you have to call -[ESTConfig setupAppID:andAppToken:] first. #import "EILIndoorLocationManager.h"
#import "ESTConfig.h"
[ESTConfig setupAppID:@"yourAppID" andAppToken:@"yourAppToken"]; You can find your API App ID and API App Token in the Apps section of the Estimote Cloud. You can check the authorization status using the following method that will return a BOOL value: [ESTConfig isAuthorized] ChangelogTo see what has changed in recent versions of Estimote Indoor Location SDK, see the CHANGELOG. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论