使用自定义方案打开应用程序-防止“;在<appname>"警告

open app with custom scheme - prevent "open in <appname>" warning?

本文关键字:lt appname 警告 quot gt 防止 方案 自定义 应用程序      更新时间:2023-09-26

我想从safari打开我的应用程序。这是info.plist中的自定义方案:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>com.appvendor.rentalapp</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>open-rental</string>
        </array>
    </dict>
</array>

如果我在狩猎中按下这样的按钮:

<a href="open-rental://custom-string">Open App</a>

我收到一个iOS警告"Open in <app-name>"。我的问题是我能阻止这个警告弹出吗?

另一项我认为这可以帮助你

setTimeout(function(){
    window.location = "weixin://";  //scheme
    setTimeout(function () {
        window.location = appstore url;
    }, 500);
}, 1);