title: Loading Maps App from iOS SDK 6.1 with Target iOS 5.0
body: <p>I'd like to support iOS5 in my app which I compile with the iOS 6.1 SDK. </p>
  
  <p>One functionality is to take the User to the Maps App. <a href="https://stackoverflow.com/questions/30058/how-can-i-launch-the-google-maps-iphone-application-from-within-my-own-native-ap/30079#30079">Here is a link</a> explaining how to do it with iOS SDK 5 for iOS 5 and also with iOS SDK 6 for iOS 6. </p>
  
  <p>However, if I use iOS 6.1 SDK and use a iOS 5 device, the <a href="http://handleopenurl.com/scheme/map" rel="nofollow noreferrer">magic URL link</a> takes me to the maps.google.com Website in Mobile Safari, not the native Maps App, as desired.</p>
  
  <p>Can this be fixed?</p>
  
  <p><strong>EDIT</strong> </p>
  
  <p>So far, I have this:</p>
  
  <pre><code>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&amp;q=Your+Place%%40%g,%g", coordinate.latitude, coordinate.longitude];
      [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
  }
  </code></pre>