简体   繁体   中英

iOS : How to enable Audio directions on Google Maps

I am using the below code to open Google Maps from my iOS application where I am passing starting and End point of places.

It navigates correctly from start point to end point but does not guide through Audio (voice) .

I want to enable voice guidance facility.

please help

ClientState *clientState = [ClientState sharedInstance];            
CLLocation *currentLocation = clientState.currentLocation;            

NSString *googleMapsURLString = [NSString stringWithFormat:@"maps://maps.google.com/?xyz=xyz&saddr=%1.8f,%1.8f&daddr=%@,%@",
         currentLocation.coordinate.latitude, currentLocation.coordinate.longitude, trip.pickupLatitude, trip.pickupLongitude];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapsURLString]];

The Maps app will handle audio guidance for you. You do not need to enable it. If you open the Apple Maps URL scheme or Google Maps app, it will guide the user via audio if they have their audio turned on. Voice directions only work on certain phones for the Apple Maps App. The iPhone 5 and 4S have voice direction, while the iPhone 4 and 3GS do not. Just like there is no Siri on iPhone 4, there is no Siri Voice Navigation.

See this thread on Apple for extra discussion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM