Sunday, 15 February 2015

iphone - Loading Maps App from iOS SDK 6.1 with Target iOS 5.0 -



iphone - Loading Maps App from iOS SDK 6.1 with Target iOS 5.0 -

i'd back upwards ios5 in app compile ios 6.1 sdk.

one functionality take user maps app. here link explaining how ios sdk 5 ios 5 , ios sdk 6 ios 6.

however, if utilize ios 6.1 sdk , utilize ios 5 device, magic url link takes me maps.google.com website in mobile safari, not native maps app, desired.

can fixed?

edit

so far, have this:

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

apple have updated url handling maps, need point maps.apple.com, appropriately re-direct google. see documentation more/how.

iphone ios ipad ios6 mapkit

No comments:

Post a Comment