【问题标题】:How to open Neshan app to show routing in swift?如何打开 Neshan 应用程序以快速显示路由?
【发布时间】:2021-04-18 06:31:53
【问题描述】:

我需要打开Neshan 应用程序(地图应用程序如Google-Map)。 这是我的代码:

if (UIApplication.sharedApplication().canOpenURL(NSURL(string:"comgooglemaps://")!)) {
    UIApplication.sharedApplication().openURL(
        NSURL(string:"comgooglemaps://?saddr=&daddr=\(place.latitude),\(place.longitude)&directionsmode=driving")!
    )
} else {
    NSLog("Can't use comgooglemaps://");
}

这不行!我该怎么办?

【问题讨论】:

    标签: ios swift routes neshan neshan-map


    【解决方案1】:

    您必须声明要在 Info.plist 中使用的 URL 方案。为此使用密钥 LSApplicationQueriesSchemes。

    将 neshan 键添加到 LSApplicationQueriesSchemes。

    然后使用这个 sn-p swift 代码使用他们的自定义架构打开应用程序。

    if UIApplication.shared.canOpenURL(URL(string: "neshan://")!) {
         
          // neshan is installed.
          let urlStr = String(format: "neshan://")
          UIApplication.shared.openURL(URL(string: urlStr)!)
       } else {
            // neshan is not installed.
     }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多