ios - How to return to your app using google callback url scheme in swift? -


i using gooogle url scheme show directions press of button in swift. how can use url callback scheme app, after have opened native google maps app. using below code

if (uiapplication.sharedapplication().canopenurl(nsurl(string:"comgooglemaps://")!)) {             uiapplication.sharedapplication().openurl(nsurl(string:                 "comgooglemaps://?saddr=&daddr=\(place.latitude),\(place.longitude)&directionsmode=driving")!)          } else {             nslog("can't use comgooglemaps://");         }     } 

i have tried referring link google map url scheme if knows how it, pls answer sample swift code

you can use openingooglemaps component provided google maps. lets encode redirect url app, displayed on top of directions in google maps application.

this code looks in swift:

var place: cllocationcoordinate2d  var definition = googledirectionsdefinition() definition.destinationpoint = googledirectionswaypoint(location: place) definition.travelmode = googlemapstravelmode.driving  openingooglemapscontroller.sharedinstance().opendirections(definition) 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -