我必须使用estimote室内位置SDK
当我的应用被杀或背景时,我必须检测到我的设备是进入或退出室内位置区域
请告诉我们如何处理这种情况。
谢谢
[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];
}
答案 0 :(得分:0)
如果您要求始终授权,则应该这样做。
在您的情况下<foreignObject x="0" y="0" width="100%" height="100%">
<picture>
<source width="1180" height="500" type="image/webp" class="lazyload" data-srcset="http://satyr.io/1180x500?2&type=webp&text=webp@1x&texture=graphpaper&delay=2g 1x,
http://satyr.io/2360x1000?type=webp&text=webp@2x&texture=graphpaper&delay=2g 2x"/>
<source width="1180" height="500" type="image/jpeg" class="lazyload" data-srcset="http://satyr.io/1180x500?2&type=jpg&text=jpg@1x&texture=graphpaper&delay=2g 1x,
http://satyr.io/2360x1000?type=jpeg&text=jpeg@2x&texture=graphpaper&delay=3g 2x"/>
<img width="1180" height="500" class="lazyload"
data-src="http://satyr.io/1180x500?2&type=jpeg&text=jpeg@1x&texture=graphpaper&delay=3g" alt=""/></picture>
</foreignObject>
参考:http://developer.estimote.com/ibeacon/tutorial/part-2-background-monitoring/
检查您是否在应用设置页面中正确授予了权限。它应该始终不在使用中。
答案 1 :(得分:0)
当您的应用被杀时,请使用HeroIcon获取estimote应用。 正如文件所说
HeroIcon
使用:信标监控,建议应用程序监控信标 iOS在锁定屏幕上显示应用程序的图标(&#34;建议的应用程序&#34;功能 在信标范围内的iOS 8中引入。
Sorce代码: https://github.com/Estimote/iOS-SDK/tree/master/Examples/objective-c/HeroIcon