我想要在特定时间进行区域监控。我有特定的活动时间,所以我想检查用户在那个特定时间是否在那个地区
2 回答
1
您可以向您的应用发送静默推送通知,该通知将在您想要的时间唤醒它。(您需要一个远程服务器来执行此操作。还有大量服务提供发送推送消息,因此您必须自己编写)
这是我所知道的应用商店安全的唯一方式
- (void)receivedNotification:(id)pushMessage {
//this will trigger the delegate to be called, check against the region there
[self.locationManager startUpdateLocations];
}
于 2016-05-10T08:15:36.343 回答
0
只需设置在特定时间关闭的计时器并开始区域监控。例如,您可以监控信标区域,
_locationManager = [[CLLocationManager alloc]init];
_locationManager.delegate = self;
[_locationManager requestAlwaysAuthorization];
NSUUID *uuid = [[NSUUID alloc]initWithUUIDString:@"FDA50693-A4E2-4FB1-AFCF-C6EB07647825"];
CLBeaconRegion *region = [[CLBeaconRegion alloc]initWithProximityUUID:uuid identifier:@"skyBeacons"];
self.myregion =region;
self.myregion.notifyOnEntry= YES;
self.myregion.notifyOnExit =YES;
[_locationManager startMonitoringForRegion:self.myregion];
然后您可以使用位置管理器委托来捕获用户/区域。
于 2016-05-10T10:52:48.210 回答