2

I have my App launching the Maps application on iOS6 using something similar to the following:

MKPlacemark* place = [[MKPlacemark alloc] initWithCoordinate: latlong addressDictionary: nil];
MKMapItem* destination = [[MKMapItem alloc] initWithPlacemark: place];
destination.name = @"Name Here!";
NSArray* items = [[NSArray alloc] initWithObjects: destination, nil];
NSDictionary* options = [[NSDictionary alloc] initWithObjectsAndKeys:
                             MKLaunchOptionsDirectionsModeDriving, 
                             MKLaunchOptionsDirectionsModeKey, nil];
[MKMapItem openMapsWithItems: items launchOptions: options];

Is there anyway to add a button or somewhow otherwise return to my App once I am in the Maps App? I'd like to return to my App without hitting the iPhone Home button and clicking on my App icon again.

Thanks!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
PhilBot
  • 748
  • 18
  • 85
  • 173
  • possible duplicate of [How to exit from Map App in IOS 6 i.e. return control back to app requesting directions?](http://stackoverflow.com/questions/15047322/how-to-exit-from-map-app-in-ios-6-i-e-return-control-back-to-app-requesting-dir) – kwerle Jan 13 '15 at 20:05

2 Answers2

2

No, since you don't control anything on the Apple Maps app, adding a button there is out of discussion.

Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
2

You may be able to use -[MKMapItem URL] to pass an app-specific scheme (such as x-com-myapp://launch) that, if the user taps, sends them back to your app.

incanus
  • 5,100
  • 1
  • 13
  • 20