I’ve been trying to get the manual Indoor Location to work, although I’ve been having trouble with it. I followed the tutorial (Add Indoor Location to an iOS app - Estimote Developer) and I got this error message.
failed to update position: Error Domain=com.estimote Code=1 “Can’t determine position outside the location.” UserInfo={NSLocalizedDescription=Can’t determine position outside the location.}
This is the code I’m using
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewDidLoad {
[super viewDidLoad];
// 4. Instantiate the location manager & set its delegate
self.locationManager = [EILIndoorLocationManager new];
self.locationManager.delegate = self;
[ESTConfig setupAppID:@"AppIDHere" andAppToken:@"AppTokenHere"];
EILRequestFetchLocation *fetchLocationRequest =
[[EILRequestFetchLocation alloc] initWithLocationIdentifier:@"LocationIdentifierHere"];
[fetchLocationRequest sendRequestWithCompletion:^(EILLocation *location,
NSError *error) {
if (location != nil) {
self.location = location;
[self.locationManager startPositionUpdatesForLocation:self.location];
} else {
NSLog(@"can't fetch location: %@", error);
}
}];
}
- (void)indoorLocationManager:(EILIndoorLocationManager *)manager
didFailToUpdatePositionWithError:(NSError *)error {
NSLog(@"failed to update position: %@", error);
}
- (void)indoorLocationManager:(EILIndoorLocationManager *)manager
didUpdatePosition:(EILOrientedPoint *)position
withAccuracy:(EILPositionAccuracy)positionAccuracy
inLocation:(EILLocation *)location {
NSString *accuracy;
switch (positionAccuracy) {
case EILPositionAccuracyVeryHigh: accuracy = @"+/- 1.00m"; break;
case EILPositionAccuracyHigh: accuracy = @"+/- 1.62m"; break;
case EILPositionAccuracyMedium: accuracy = @"+/- 2.62m"; break;
case EILPositionAccuracyLow: accuracy = @"+/- 4.24m"; break;
case EILPositionAccuracyVeryLow: accuracy = @"+/- ? :-("; break;
case EILPositionAccuracyUnknown: accuracy = @"unknown"; break;
}
NSLog(@"x: %5.2f, y: %5.2f, orientation: %3.0f, accuracy: %@",
position.x, position.y, position.orientation, accuracy);
}
I seemed to have the same problem the person in here did (https://forums.estimote.com/t/func-indoorlocationmanager-didupdateposition-position-is-not-invoked), although I’m not sure how he fixed his problem, someone suggested to move “[self.locationManager startPositionUpdatesForLocation:self.location];” into didViewAppear, when I did this, the error disappeared but then nothing happened, I didn’t get any output so the output was blank. I’m not sure what I need to do to fix this.