【问题标题】:Titanium.Platform.canOpenURL doesn't work on IOS 10Titanium.Platform.canOpenURL 在 IOS 10 上不起作用
【发布时间】:2016-10-24 08:45:19
【问题描述】:

我正在使用Ti.Platform.canOpenURL() 打开另一个在 iOS 10 之前运行良好的应用程序。

但它不适用于 iOS 10 及更高版本。

如何解决?

【问题讨论】:

    标签: titanium appcelerator titanium-mobile appcelerator-titanium


    【解决方案1】:

    您使用Ti.Platform.canOpenURL('<my-url>') 来检查网址。要打开网址,您需要改用Ti.Platform.openURL('<my-url>')

    【讨论】:

    • 谢谢,但我需要使用 Ti.Platform.canOpenURL 来检查是否先安装了下一个应用程序。
    • 确保您在 plist 中正确配置了 url 方案:iosdevelopertips.com/cocoa/…
    【解决方案2】:

    With some of the new security features of iOS9, SDK 5.1.2's canOpenUrl might fail without adding in the proper properties in the info.plist file.

    因此,您需要将以下key 添加到tiapp.xml 文件中:

    <ios>
        <plist>
            <dict>
                <key>LSApplicationQueriesSchemes</key>
                <array>
                        <string>[Your Project Name]</string>
                        <string>[Your Second Project Name (if any)]</string>
                </array>
            </dict> 
        </plist>
    </ios>
    

    希望这会有所帮助。
    干杯。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-24
      • 2017-12-26
      • 1970-01-01
      • 2018-01-04
      • 2017-01-28
      • 2020-10-08
      • 2020-12-08
      相关资源
      最近更新 更多