最終的に、新しいプロジェクトを試してテストしました。
[[Geofence sharedInstance] startUpdatingLocation];
ジオフェンス.h
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
@interface Geofence : NSObject <CLLocationManagerDelegate>
@property (strong, nonatomic) CLLocationManager *locationManager;
+ (Geofence *)sharedInstance;
- (void)startUpdatingLocation;
- (void)deactiveMonitoring;
FOUNDATION_EXPORT void GeneratelPushNotification(NSString *text);
@end
ジオフェンス.m
#import "Geofence.h"
@implementation Geofence
+ (Geofence *)sharedInstance
{
static Geofence *instance;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[Geofence alloc] init];
});
return instance;
}
- (instancetype)init
{
self = [super init];
if (!self) {
return nil;
}
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
self.locationManager.distanceFilter = kCLDistanceFilterNone;
self.locationManager.delegate = self;
return self;
}
FOUNDATION_EXPORT void GeneratelPushNotification(NSString *text)
{
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.fireDate = [NSDate date];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody = text;
localNotif.alertAction = NSLocalizedString(@"ok", nil);
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.userInfo = nil;
[[UIApplication sharedApplication] presentLocalNotificationNow:localNotif];
}
- (void)startUpdatingLocation
{
[self.locationManager startUpdatingLocation];
}
- (void)deactiveMonitoring
{
NSLog(@"deactiveMonitoring");
if (self.locationManager.monitoredRegions.allObjects.count > 0) {
NSLog(@"more then 0 regions");
for (CLRegion *region in self.locationManager.monitoredRegions) {
NSLog(@"cancel region");
[self.locationManager stopMonitoringForRegion:region];
}
}
}
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
CLLocation *currentLocation = locations.lastObject;
NSLog(@"didUpdateLocations, currentLocation: %@", currentLocation);
if (currentLocation && currentLocation.coordinate.latitude != 0.0 && currentLocation.coordinate.longitude != 0.0) {
NSLog(@"didUpdateLocations, location is valid.");
[self deactiveMonitoring];
NSString *regionIdentifier = [[NSDate date] description];
CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:currentLocation.coordinate radius:100 identifier:regionIdentifier];
[manager startMonitoringForRegion:region];
[manager stopUpdatingLocation];
NSLog(@"didUpdateLocations, end of if.");
}
}
- (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region
{
NSLog(@"didDetermineState, state: %d, region: %@", state, region);
}
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
{
NSLog(@"didEnterRegion, region: %@", region);
}
- (void)locationManager:(CLLocationManager *)manager didStartMonitoringForRegion:(CLRegion *)region
{
NSLog(@"didStartMonitoringForRegion, region: %@", region);
}
- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region
{
NSLog(@"didExitRegion: %@", region);
CLLocation *oldRegionLocation = [[CLLocation alloc] initWithLatitude:region.center.latitude longitude:region.center.longitude];
CLLocation *currentLocation = manager.location;
NSLog(@"didExitRegion, currentLocation: %@", currentLocation);
CLLocationDistance distanceBetween = [currentLocation distanceFromLocation:oldRegionLocation];
NSLog(@"didExitRegion, distanceBetween: %f", distanceBetween);
GeneratelPushNotification([NSString stringWithFormat:@"didExitRegion: {%f, %f}, distance: %f",
region.center.latitude, region.center.longitude, distanceBetween]);
[self deactiveMonitoring];
if (currentLocation && currentLocation.coordinate.latitude != 0.0 && currentLocation.coordinate.longitude != 0.0) {
NSLog(@"didExitRegion, location is valid.");
NSString *regionIdentifier = [[NSDate date] description];
CLCircularRegion *newRegion = [[CLCircularRegion alloc] initWithCenter:currentLocation.coordinate radius:100 identifier:regionIdentifier];
[manager startMonitoringForRegion:newRegion];
NSLog(@"didExitRegion, end of if.");
}
}
@end
iPhone 4、iOS 7.1.2 にログインし、アプリが実行されていません。
2014-07-03 10:03:07.863 Geofence[449:60b] didUpdateLocations, currentLocation: <+31.24189568,+34.78870079> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:03:07 Israel Daylight Time
2014-07-03 10:03:07.878 Geofence[449:60b] didUpdateLocations, location is valid.
2014-07-03 10:03:07.886 Geofence[449:60b] deactiveMonitoring
2014-07-03 10:03:07.926 Geofence[449:60b] didUpdateLocations, end of if.
2014-07-03 10:03:07.962 Geofence[449:60b] didUpdateLocations, currentLocation: <+31.24189568,+34.78870079> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:03:07 Israel Daylight Time
2014-07-03 10:03:07.972 Geofence[449:60b] didUpdateLocations, location is valid.
2014-07-03 10:03:07.974 Geofence[449:60b] deactiveMonitoring
2014-07-03 10:03:08.028 Geofence[449:60b] more then 0 regions
2014-07-03 10:03:08.088 Geofence[449:60b] cancel region
2014-07-03 10:03:08.092 Geofence[449:60b] didUpdateLocations, end of if.
2014-07-03 10:03:08.096 Geofence[449:60b] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:03:07 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:03:08.489 Geofence[449:60b] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:03:08 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:13:16.946 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:03:07 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:13:16.983 Geofence[486:707] didExitRegion, currentLocation: <+31.24067170,+34.79051177> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:13:16 Israel Daylight Time
2014-07-03 10:13:16.992 Geofence[486:707] didExitRegion, distanceBetween: 219.498320
2014-07-03 10:13:17.011 Geofence[486:707] deactiveMonitoring
2014-07-03 10:13:17.651 Geofence[486:707] more then 0 regions
2014-07-03 10:13:17.661 Geofence[486:707] cancel region
2014-07-03 10:13:17.709 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:13:17.723 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:13:17.916 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:03:07 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:13:17.922 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:03:08 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:13:17.929 Geofence[486:707] didExitRegion, currentLocation: <+31.24067170,+34.79051177> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:13:16 Israel Daylight Time
2014-07-03 10:13:17.993 Geofence[486:707] didExitRegion, distanceBetween: 219.498320
2014-07-03 10:13:18.404 Geofence[486:707] deactiveMonitoring
2014-07-03 10:13:18.416 Geofence[486:707] more then 0 regions
2014-07-03 10:13:18.435 Geofence[486:707] cancel region
2014-07-03 10:13:18.445 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:13:18.470 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:13:18.636 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:03:08 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:13:18.696 Geofence[486:707] didUpdateLocations, currentLocation: <+31.24067179,+34.79051129> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:13:16 Israel Daylight Time
2014-07-03 10:13:18.705 Geofence[486:707] didUpdateLocations, location is valid.
2014-07-03 10:13:18.712 Geofence[486:707] deactiveMonitoring
2014-07-03 10:13:18.731 Geofence[486:707] more then 0 regions
2014-07-03 10:13:18.753 Geofence[486:707] cancel region
2014-07-03 10:13:18.769 Geofence[486:707] didUpdateLocations, end of if.
2014-07-03 10:13:19.063 Geofence[486:707] didUpdateLocations, currentLocation: <+31.24067179,+34.79051129> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:13:16 Israel Daylight Time
2014-07-03 10:13:19.086 Geofence[486:707] didUpdateLocations, location is valid.
2014-07-03 10:13:19.093 Geofence[486:707] deactiveMonitoring
2014-07-03 10:13:19.102 Geofence[486:707] more then 0 regions
2014-07-03 10:13:19.115 Geofence[486:707] cancel region
2014-07-03 10:13:19.128 Geofence[486:707] didUpdateLocations, end of if.
2014-07-03 10:13:19.469 Geofence[486:707] didUpdateLocations, currentLocation: <+31.24067111,+34.79051330> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:13:16 Israel Daylight Time
2014-07-03 10:13:19.476 Geofence[486:707] didUpdateLocations, location is valid.
2014-07-03 10:13:19.481 Geofence[486:707] deactiveMonitoring
2014-07-03 10:13:19.494 Geofence[486:707] more then 0 regions
2014-07-03 10:13:19.518 Geofence[486:707] cancel region
2014-07-03 10:13:19.622 Geofence[486:707] didUpdateLocations, end of if.
2014-07-03 10:13:19.636 Geofence[486:707] didUpdateLocations, currentLocation: <+31.24067170,+34.79051177> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:13:16 Israel Daylight Time
2014-07-03 10:13:19.644 Geofence[486:707] didUpdateLocations, location is valid.
2014-07-03 10:13:19.670 Geofence[486:707] deactiveMonitoring
2014-07-03 10:13:19.742 Geofence[486:707] more then 0 regions
2014-07-03 10:13:20.016 Geofence[486:707] cancel region
2014-07-03 10:13:20.042 Geofence[486:707] didUpdateLocations, end of if.
2014-07-03 10:13:20.049 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:13:17 +0000', center:<+31.24067170,+34.79051177>, radius:100.00m)
2014-07-03 10:13:20.054 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:13:18 +0000', center:<+31.24067170,+34.79051177>, radius:100.00m)
2014-07-03 10:13:20.085 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:13:18 +0000', center:<+31.24067179,+34.79051129>, radius:100.00m)
2014-07-03 10:13:20.232 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:13:19 +0000', center:<+31.24067179,+34.79051129>, radius:100.00m)
2014-07-03 10:13:20.401 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:13:19 +0000', center:<+31.24067111,+34.79051330>, radius:100.00m)
2014-07-03 10:13:20.414 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:13:20 +0000', center:<+31.24067170,+34.79051177>, radius:100.00m)
2014-07-03 10:17:02.317 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:13:20 +0000', center:<+31.24067170,+34.79051177>, radius:100.00m)
2014-07-03 10:17:02.419 Geofence[486:707] didExitRegion, currentLocation: <+31.23952719,+34.79196977> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:17:02 Israel Daylight Time
2014-07-03 10:17:02.435 Geofence[486:707] didExitRegion, distanceBetween: 188.134236
2014-07-03 10:17:02.681 Geofence[486:707] deactiveMonitoring
2014-07-03 10:17:02.697 Geofence[486:707] more then 0 regions
2014-07-03 10:17:02.730 Geofence[486:707] cancel region
2014-07-03 10:17:02.745 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:17:02.752 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:17:02.762 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:13:20 +0000', center:<+31.24067170,+34.79051177>, radius:100.00m)
2014-07-03 10:17:02.894 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:17:02 +0000', center:<+31.23952719,+34.79196977>, radius:100.00m)
2014-07-03 10:20:42.460 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:17:02 +0000', center:<+31.23952719,+34.79196977>, radius:100.00m)
2014-07-03 10:20:42.593 Geofence[486:707] didExitRegion, currentLocation: <+31.23803334,+34.79391603> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:20:42 Israel Daylight Time
2014-07-03 10:20:42.597 Geofence[486:707] didExitRegion, distanceBetween: 248.616173
2014-07-03 10:20:42.829 Geofence[486:707] deactiveMonitoring
2014-07-03 10:20:42.845 Geofence[486:707] more then 0 regions
2014-07-03 10:20:42.876 Geofence[486:707] cancel region
2014-07-03 10:20:42.896 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:20:42.912 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:20:42.917 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:17:02 +0000', center:<+31.23952719,+34.79196977>, radius:100.00m)
2014-07-03 10:20:43.047 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:20:42 +0000', center:<+31.23803334,+34.79391603>, radius:100.00m)
2014-07-03 10:24:32.434 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:20:42 +0000', center:<+31.23803334,+34.79391603>, radius:100.00m)
2014-07-03 10:24:32.476 Geofence[486:707] didExitRegion, currentLocation: <+31.23773124,+34.79202236> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:24:32 Israel Daylight Time
2014-07-03 10:24:32.490 Geofence[486:707] didExitRegion, distanceBetween: 183.486002
2014-07-03 10:24:32.523 Geofence[486:707] deactiveMonitoring
2014-07-03 10:24:32.743 Geofence[486:707] more then 0 regions
2014-07-03 10:24:32.775 Geofence[486:707] cancel region
2014-07-03 10:24:32.788 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:24:32.804 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:24:32.808 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:20:42 +0000', center:<+31.23803334,+34.79391603>, radius:100.00m)
2014-07-03 10:24:32.942 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:24:32 +0000', center:<+31.23773124,+34.79202236>, radius:100.00m)
2014-07-03 10:28:48.125 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:24:32 +0000', center:<+31.23773124,+34.79202236>, radius:100.00m)
2014-07-03 10:28:48.233 Geofence[486:707] didExitRegion, currentLocation: <+31.23925385,+34.78998077> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:28:48 Israel Daylight Time
2014-07-03 10:28:48.290 Geofence[486:707] didExitRegion, distanceBetween: 257.540389
2014-07-03 10:28:48.550 Geofence[486:707] deactiveMonitoring
2014-07-03 10:28:48.575 Geofence[486:707] more then 0 regions
2014-07-03 10:28:48.593 Geofence[486:707] cancel region
2014-07-03 10:28:48.619 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:28:48.634 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:28:48.639 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:24:32 +0000', center:<+31.23773124,+34.79202236>, radius:100.00m)
2014-07-03 10:28:48.742 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:28:48 +0000', center:<+31.23925385,+34.78998077>, radius:100.00m)
2014-07-03 10:32:29.427 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:28:48 +0000', center:<+31.23925385,+34.78998077>, radius:100.00m)
2014-07-03 10:32:29.474 Geofence[486:707] didExitRegion, currentLocation: <+31.24078335,+34.78924175> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:32:29 Israel Daylight Time
2014-07-03 10:32:29.477 Geofence[486:707] didExitRegion, distanceBetween: 183.614558
2014-07-03 10:32:29.684 Geofence[486:707] deactiveMonitoring
2014-07-03 10:32:29.710 Geofence[486:707] more then 0 regions
2014-07-03 10:32:29.732 Geofence[486:707] cancel region
2014-07-03 10:32:29.750 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:32:29.762 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:32:29.772 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:28:48 +0000', center:<+31.23925385,+34.78998077>, radius:100.00m)
2014-07-03 10:32:29.928 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:32:29 +0000', center:<+31.24078335,+34.78924175>, radius:100.00m)
2014-07-03 10:34:30.808 Geofence[486:707] didEnterRegion, region: CLCircularRegion (identifier:'2014-07-03 07:03:07 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:34:30.834 Geofence[486:707] didDetermineState, state: 1, region: CLCircularRegion (identifier:'2014-07-03 07:03:07 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:35:11.038 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:03:07 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:35:11.135 Geofence[486:707] didExitRegion, currentLocation: <+31.24338224,+34.78568168> +/- 112.92m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:35:11 Israel Daylight Time
2014-07-03 10:35:11.152 Geofence[486:707] didExitRegion, distanceBetween: 331.485582
2014-07-03 10:35:11.190 Geofence[486:707] deactiveMonitoring
2014-07-03 10:35:11.467 Geofence[486:707] more then 0 regions
2014-07-03 10:35:11.495 Geofence[486:707] cancel region
2014-07-03 10:35:11.544 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:35:11.552 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:35:11.557 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:03:07 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:35:11.562 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:32:29 +0000', center:<+31.24078335,+34.78924175>, radius:100.00m)
2014-07-03 10:35:11.684 Geofence[486:707] didExitRegion, currentLocation: <+31.24338224,+34.78568168> +/- 112.92m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:35:11 Israel Daylight Time
2014-07-03 10:35:11.697 Geofence[486:707] didExitRegion, distanceBetween: 445.023446
2014-07-03 10:35:11.916 Geofence[486:707] deactiveMonitoring
2014-07-03 10:35:11.949 Geofence[486:707] more then 0 regions
2014-07-03 10:35:11.996 Geofence[486:707] cancel region
2014-07-03 10:35:12.012 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:35:12.031 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:35:12.082 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:32:29 +0000', center:<+31.24078335,+34.78924175>, radius:100.00m)
2014-07-03 10:35:12.140 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:35:11 +0000', center:<+31.24338224,+34.78568168>, radius:100.00m)
2014-07-03 10:35:12.160 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:35:12 +0000', center:<+31.24338224,+34.78568168>, radius:100.00m)
2014-07-03 10:38:49.971 Geofence[486:707] didEnterRegion, region: CLCircularRegion (identifier:'2014-07-03 07:03:07 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:38:49.977 Geofence[486:707] didDetermineState, state: 1, region: CLCircularRegion (identifier:'2014-07-03 07:03:07 +0000', center:<+31.24189568,+34.78870079>, radius:100.00m)
2014-07-03 10:38:49.988 Geofence[486:707] didExitRegion: CLCircularRegion (identifier:'2014-07-03 07:35:12 +0000', center:<+31.24338224,+34.78568168>, radius:100.00m)
2014-07-03 10:38:50.040 Geofence[486:707] didExitRegion, currentLocation: <+31.24191178,+34.78860343> +/- 65.00m (speed -1.00 mps / course -1.00) @ 7/3/14, 10:38:50 Israel Daylight Time
2014-07-03 10:38:50.134 Geofence[486:707] didExitRegion, distanceBetween: 322.566301
2014-07-03 10:38:50.432 Geofence[486:707] deactiveMonitoring
2014-07-03 10:38:50.555 Geofence[486:707] more then 0 regions
2014-07-03 10:38:50.571 Geofence[486:707] cancel region
2014-07-03 10:38:50.587 Geofence[486:707] didExitRegion, location is valid.
2014-07-03 10:38:50.661 Geofence[486:707] didExitRegion, end of if.
2014-07-03 10:38:50.667 Geofence[486:707] didDetermineState, state: 2, region: CLCircularRegion (identifier:'2014-07-03 07:35:12 +0000', center:<+31.24338224,+34.78568168>, radius:100.00m)
2014-07-03 10:38:50.734 Geofence[486:707] didStartMonitoringForRegion, region: CLCircularRegion (identifier:'2014-07-03 07:38:50 +0000', center:<+31.24191178,+34.78860343>, radius:100.00m)
問題は次のとおりです。
ユーザーがデバイスの電源を切り、別の地域で再び電源を入れたと仮定すると、デバイスは現在の場所を監視しないため、significantLocationChanges
.
しかし、使用significantLocationChanges
すると何かが台無しになるのではないかと心配しています。