[英]how to update device position in estimote indoor location when application is killed or Background
I have to use estimote indoor location SDK 我必须使用估算室内位置SDK
i have to detect my device is enter or exit of the indoor location area when my app is killed or background 当我的应用被杀死或背景出现时,我必须检测到我的设备正在进入或退出室内位置区域
please tell me guys how to tackle this scenario. 请告诉我如何解决这种情况。
Thanks 谢谢
[ESTConfig setupAppID:@"" andAppToken:@""];
locationManger = [[EILIndoorLocationManager alloc]init];
locationManger.delegate = self;
EILRequestFetchLocation *fetchLocationreq = [[EILRequestFetchLocation alloc]initWithLocationIdentifier:@"test-2c5"];
[fetchLocationreq sendRequestWithCompletion:^(EILLocation * _Nullable location, NSError * _Nullable error) {
if (location != nil) {
locationEILL = location;
locationView.showTrace = YES;
locationView.rotateOnPositionUpdate = YES;
[locationView drawLocation:location];
[locationManger startMonitoringForLocation:locationEILL];
[locationManger startPositionUpdatesForLocation:locationEILL];
}
}];
}
#pragma mark - EILLindoorlocationmanager Delegate
- (void)indoorLocationManager:(EILIndoorLocationManager *)manager
didUpdatePosition:(EILOrientedPoint *)position
withAccuracy:(EILPositionAccuracy)positionAccuracy
inLocation:(EILLocation *)location
{
NSLog(@"x: %5.2f, y: %5.2f, orientation: %3.0f", position.x,position.y,position.orientation);
[locationView updatePosition:position];
}
It should be done if you are asking for always authorization. 如果您要求始终授权,则应这样做。 in your case beaconManager.requestAlwaysAuthorization()
在你的情况下beaconManager.requestAlwaysAuthorization()
reference: http://developer.estimote.com/ibeacon/tutorial/part-2-background-monitoring/ 参考: http : //developer.estimote.com/ibeacon/tutorial/part-2-background-monitoring/
Check if you grant the permission correctly in you app setting page. 在应用设置页面中检查您是否正确授予了权限。 It should be always not when in use. 使用时应始终不使用它。
When your app is killed use HeroIcon for estimote app. 当您的应用程序被杀死时,请使用HeroIcon作为评估应用程序。 As documentations says 如文件所述
HeroIcon 英雄图标
Uses: beacon monitoring, suggested apps Monitor for a beacon to have iOS show the app's icon on the lock screen ("suggested apps" feature introduced in iOS 8) when in range of the beacon. 用途:信标监视,建议的应用程序在信标范围内时,监视信标以使iOS在锁定屏幕上显示应用程序的图标(iOS 8中引入了“建议的应用程序”功能)。
Sorce Code: https://github.com/Estimote/iOS-SDK/tree/master/Examples/objective-c/HeroIcon 源代码: https : //github.com/Estimote/iOS-SDK/tree/master/Examples/objective-c/HeroIcon
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.