iOS6.1SDKでコンパイルしたアプリでiOS5をサポートしたいと思います。
1つの機能は、ユーザーをマップアプリに移動することです。これは、iOS5用のiOSSDK5およびiOS6用のiOSSDK6でそれを行う方法を説明するリンクです。
ただし、iOS 6.1SDKを使用してiOS5デバイスを使用している場合、魔法のURLリンクを使用すると、必要に応じて、ネイティブのマップアプリではなく、モバイルSafariのmaps.google.comWebサイトに移動します。
これは修正できますか?
編集
これまでのところ、私はこれを持っています:
BOOL appleMapsSupported = FALSE;
NSString *reqSysVer = @"6.0";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending)
appleMapsSupported = TRUE;
if (appleMapsSupported){
NSLog(@"device version %@", [[UIDevice currentDevice] systemVersion]);
MKPlacemark* placemark = [[MKPlacemark alloc] initWithCoordinate:coordinate addressDictionary:@{(NSString*)kABPersonAddressStreetKey:@"Your Place"}];
MKMapItem* mapItem = [[MKMapItem alloc] initWithPlacemark:placemark];
[mapItem openInMapsWithLaunchOptions:@{MKLaunchOptionsDirectionsModeKey : MKLaunchOptionsDirectionsModeWalking}];
}else{
NSString* url = [NSString stringWithFormat:@"http://maps.google.com/?t=m&q=Your+Place%%40%g,%g", coordinate.latitude, coordinate.longitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}