Created
December 3, 2013 05:47
-
-
Save key/7764471 to your computer and use it in GitHub Desktop.
iPhone5sの位置情報水平精度を取得してみた ref: http://qiita.com/key/items/1d196c4ec477f8773cd1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (id)init | |
{ | |
self = [super init]; | |
if (self) { | |
_locationManager = [[CLLocationManager alloc] init]; | |
_locationManager.delegate = self; | |
[_locationManager startUpdatingLocation]; | |
[Flurry startSession:@"YOUR_FLURRY_API_KEY"]; | |
} | |
return self; | |
} | |
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation | |
{ | |
// ログ用のdictionaryを作成 | |
NSDictionary *params = @{ | |
@"latitude": [NSNumber numberWithDouble:newLocation.coordinate.latitude], | |
@"longitude": [NSNumber numberWithDouble:newLocation.coordinate.longitude], | |
@"horizontalAccuracy": [NSNumber numberWithDouble:newLocation.horizontalAccuracy], // 水平精度 | |
@"verticalAccuracy": [NSNumber numberWithDouble:newLocation.verticalAccuracy], // 垂直精度 | |
}; | |
// Flurryにログ記録 | |
[Flurry logEvent:@"CLLocation" withParameters:params]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment