I\'m using Google Cardboard with the Street View App. I want to be able to create a link that sends users directly into the Street View App to view a specific location.
You can launch the Google Maps for iOS application in street view mode with the comgooglemaps URL Scheme by setting the mapmode parameter to streetview.
Objective c
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"comgooglemaps://"]]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"comgooglemaps://?center=46.414382,10.013988&mapmode=streetview"]]];
}
Swift 4
if UIApplication.shared.canOpenURL(URL(string: "comgooglemaps://")!) {
guard let url = URL(string: "comgooglemaps://?center=46.414382,10.013988&mapmode=streetview") else {
return //be safe
}
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(url)
}
}
& more details here on Google Streetview.