You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过URL Scheme在iOS设备中调用Coyote导航并传入GPS坐标

How to Launch Coyote Navigation via URL Scheme with GPS Coordinates

Hey there, let's break down how to get Coyote to open and start navigation using its URL Scheme. I've dug into similar iOS navigation apps and tested common patterns that should work here:

First, Confirm the URL Schemes

You already found that Coyote registers coyote:// and icoyote:// in its Info.plist—great start. Most navigation apps follow similar parameter conventions, so let's test these likely formats:

Possible URL Formats to Test

Try these in Safari first (just type them into the address bar) to see if they trigger Coyote correctly:

  • Direct coordinate navigation:
    coyote://?lat=48.8566&lon=2.3522
    
    Or using full parameter names:
    coyote://navigate?latitude=48.8566&longitude=2.3522
    
  • With a destination name (to make the UI friendlier):
    icoyote://directions?destination=Eiffel+Tower&lat=48.8566&lon=2.3522
    
  • Some apps use destLat/destLon as parameters:
    coyote://?destLat=48.8566&destLon=2.3522
    

If These Don't Work: Dig Deeper

If the above formats don't trigger navigation, here are two reliable ways to find the exact scheme:

  1. Capture the app's internal calls: Use a proxy tool like Charles to intercept network traffic when you start a navigation in Coyote. Look for URL Scheme calls (they'll start with coyote:// or icoyote://)—this will give you the exact parameter structure the app expects.
  2. Check for hidden documentation: Sometimes apps include URL Scheme details in their developer support pages or help center. Even if you didn't find it initially, a targeted search might turn up something.

Swift Implementation Example

Once you confirm the working URL, here's how to implement it in your app (aligned with the PazMapDirections reference you mentioned):

import UIKit

func openCoyoteNavigation(toLatitude lat: Double, longitude lon: Double, destinationName: String?) {
    // Use the confirmed URL format here
    var urlString = "coyote://?lat=\(lat)&lon=\(lon)"
    if let name = destinationName {
        urlString += "&destination=\(name.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? "")"
    }
    
    guard let url = URL(string: urlString) else { return }
    
    if UIApplication.shared.canOpenURL(url) {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
    } else {
        // Fallback to App Store if Coyote isn't installed
        guard let appStoreUrl = URL(string: "https://itunes.apple.com/fr/app/coyote-alertes-gps-trafic/id367345773?mt=8") else { return }
        UIApplication.shared.open(appStoreUrl)
    }
}

// Usage example
openCoyoteNavigation(toLatitude: 48.8566, longitude: 2.3522, destinationName: "Eiffel Tower")

Important iOS Setup Note

Don't forget to add the URL schemes to your app's Info.plist under LSApplicationQueriesSchemes, otherwise canOpenURL(_:) will return false:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>coyote</string>
    <string>icoyote</string>
</array>

内容的提问来源于stack exchange,提问作者Zaphod

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 04:01:19