如何注册应用程序以打开位置

How to Register an App to Open a Location

我们有一个汽车应用程序,我们希望在位置共享时打开它 - 即,当用户尝试在地图中共享位置时,会显示一个可用的应用程序列表,例如 Messenger、Viber、Mail 等。

我们添加了功能,但我们只在 "Routing Apps" 下显示。我们还需要出现在 "open/share with" 应用列表中。

我们当前的设置:

地图 - 已启用(汽车),

在 info.plist 文件中:

<dict>
        <key>CFBundleTypeName</key>
        <string>MKDirectionsRequest</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.apple.maps.directionsrequest</string>
        </array>
    </dict>

由于 Apple 不使用 "maps" URL 方案,因此仅注册该方案是行不通的。

知道我们缺少什么吗?

谢谢!

您需要为分机提供

NSExtensionActivationSupportsWebURLWithMaxCount

键并将此布尔值设置为 true。 iOS 将位置作为网址处理,因此这应该可以帮助您。

Reference