
不幸的是,我无法收到任何小于100米的过境点的通知.
我创建了半径为20米/ 50米或70米的区域,一旦我越过100米边界,我总是只收到通知.
但我希望有一个更精细的半径 – 例如20米并且还收到通知.如果我有一个大于100米的范围,一切都很好 – 例如
150米.在这种情况下,一旦我按照预期进入150米,我就会收到通知.
我尝试使用LocationManager上的“kCLLocationAccuracy”设置和CLRegions的创建,但两者都没有
似乎有任何影响.
这是我使用的代码:
- (voID) initializeLocationManager{ // Check to ensure location services are enabled if(![CLLocationManager locationServicesEnabled]) { [self showAlertWithMessage:@"You need to enable location services to use this app."]; return; } if(![CLLocationManager regionMonitoringAvailable]) { [self showAlertWithMessage:@"This app requires region monitoring features which are unavailable on this device."]; return; } self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self.locationManager.distanceFilter = kCLdistanceFilterNone; // whenever we move}- (voID) setupGeoFence:(Station*)station{ CLLocationCoordinate2D centerCoordinate = CLLocationCoordinate2DMake([station.gpsposition.latitude doubleValue],[station.gpsposition.longitude doubleValue]); CLRegion *geofence = [[CLRegion alloc] initCircularRegionWithCenter:centerCoordinate radius:[range doubleValue] IDentifIEr:station.name]; [self.locationManager startMonitoringForRegion:geofence desiredAccuracy:kCLLocationAccuracyBest];} 有没有人知道如何在更近的边界接收通知?任何帮助都会受到高度关注.
谢谢
Hamtho
如果您确实需要细粒度的位置更新,您可能需要实施自己的检查或启动GPS以获得非常准确的读数.这伴随着电池一击,因此您的里程可能会有所不同.祝好运.
@H_403_0@ 总结以上是内存溢出为你收集整理的LocatinManager的iOS CLRegion功能的最小半径全部内容,希望文章能够帮你解决LocatinManager的iOS CLRegion功能的最小半径所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)