简体   繁体   English

当应用程序被杀死或后台时如何更新估计位置的设备位置

[英]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.

相关问题 当应用程序被杀死时,如何获取准确的位置更新? - How to get accurate location update when application is killed? Estimote室内位置列表无法正常工作 - Estimote indoor location list can't work 当应用在iOS中被杀死时,如何检测估计信标? - How to detect estimote beacon when app is killed in ios? 当应用程序在后台被杀死时,如何执行清理? - How to perform cleanup when application is killed in background? 无法使用iOS Estimote Indoor SDK手动创建位置 - Can't create location manually using iOS Estimote Indoor SDK 当应用程序处于后台或被杀时,如何定期获取新位置 - How to get periodicaly new location when app is in background or killed 应用程序在后台运行时如何获取室内位置X和Y位置? - How to get indoor location X and Y postion when app runs in Background? 当应用被用户杀死时如何重新启动位置更新? - How to restart the location update when the app is killed by user? 即使应用程序被杀死,如何获得设备锁定和解锁? - How to get device lock and unlock even when the application was killed? iOS 7-后台位置应用在获取后台位置时被杀死 - iOS 7 - Background Location app getting killed when getting a background location
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM