Xcode和Waze的整合(xcode and waze integration)

2019-09-17 09:07发布

我想我的应用程序集成的Waze 。

任何人都知道我怎么能叫位智和发送的坐标?

我没有发现任何API或有关它的其他信息..

Answer 1:

- (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"]];
   }
}


文章来源: xcode and waze integration
标签: ios xcode