Search code examples
iosgoogle-maps-sdk-ios

Get directions in my app when someone uses Google Maps directions


When someone uses the Google Maps app on iOS to get directions, I would like to know in real time the destination of the user and the direction. The goal is not for him to use my app to navigate but for my app to suggest him places in real time along his route (and in advance).

Do you think this is feasible with the Google Maps API for iOS? If yes, how would you do it? And if no, do you have other ideas?

Thank you !


Solution

  • This isn't possible in the way that you're framing the question, but it is possible to include Google Maps in your own application if you combine the Google Maps SDK for iOS, the Google Directions API (on the web), and either the Google Places API or the Yelp API.

    Use the Google Directions API to get directions (a list of lat/lng points in JSON form), plot these points as Polyline using the Google Maps SDK for iOS, and use those points to search for nearby points of interest with the Google Places API or the Yelp API.