iOS: Region Monitoring at a specific time

113 Views Asked by At

I want region monitoring at specific time. I have particular event time so I want to check is the user is in that region on that particular time

2

There are 2 best solutions below

7
Daij-Djan On

you can send your app a silent push notification that will wake it up at the time you want. (you'd need a remote server to do this . there are also tons of services that offer to send push messages so you want have to write your own)

that's the only way appstore-safe way I know

- (void)receivedNotification:(id)pushMessage {
     //this will trigger the delegate to be called, check against the region there
     [self.locationManager startUpdateLocations];
}
1
Manoj Karki On

just set the timer that goes off at specific time and start region monitoring. For example you can monitor the beacon regions,

_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];

then you can use location manager delegate to catch the user/region.