Andoxko
Andoxko

Reputation: 1031

Back button on google maps ios

My Iphone app needs to open the google maps application to use the StreetView and the directions mode.

All works fine,But my question is, is there any way of adding a button or something to go back to my app?. I have seen that with UIWebViews maybe thats the only solution..

Thanks in advance

Upvotes: 1

Views: 1510

Answers (1)

Colin Tremblay
Colin Tremblay

Reputation: 387

My answer comes from this documentation: Google Maps SDK for iOS, Google Maps URL Scheme

You may add a back button if you register a custom URL scheme for your app and use the comgooglemaps-x-callback:// url scheme to launch the Google Maps iOS app.

Here is a great tutorial for iOS Custom URL Schemes.

The following string would open Google Maps with directions to JFK airport and would add a button in Google Maps with the title "AirApp". Touching that button would call the custom url scheme sourceapp:// which you would set up by following the tutorial I linked to above.

@"comgooglemaps-x-callback://?daddr=John+F.+Kennedy+International+Airport,+Van+Wyck+Expressway,+Jamaica,+New+York&x-success=sourceapp://?resume=true&x-source=AirApp"

Upvotes: 3

Related Questions