URL scheme can be used to launch waze with parameters from 3rd party app, email, SMS, web page link etc.
Following are the available parameters at the moment:
search for address:
waze://?q=<address search term>
center map to lat / lon:
waze://?ll=<lat>,<lon>
set zoom (minimum is 6):
waze://?z=<zoom>
The following code snippet example will navigate to lat/lon if Waze is installed, or else will launch the AppStore to install Waze.
- (void) navigateToLatitude:(double)latitude
longitude:(double)longitude
{
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"waze://"]]) {
//Waze is installed. Launch Waze and start navigation
NSString *urlStr = [NSString stringWithFormat:@"waze://?ll=%f,%f&navigate=yes", latitude, longitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
} else {
//Waze is not installed. Launch AppStore to install Waze app
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/us/app/id323229106"]];
}
}
The following code snippet example will launch Waze to look for the specified location, if Waze is installed. If Waze is not installed it will open Waze page on the Market application.
try
{
String url = "waze://?q=Hawaii";
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( url ) );
startActivity( intent );
}
catch ( ActivityNotFoundException ex )
{
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "market://details?id=com.waze" ) );
startActivity(intent);
}