ios – xcode和waze集成

前端之家收集整理的这篇文章主要介绍了ios – xcode和waze集成前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试将我的应用程序与 waze集成.

任何人都知道如何调用waze并发送坐标?

我没有找到任何关于它的API或其他信息..

解决方法

- (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相关文章