javascript - 从浏览器打开的原生移动应用 (iOS 13)
问题描述
我在网站上有一个代码,它正在检查用户代理并根据操作系统导航到本机应用程序。
function openPage(webUrl, appUrl) {
var loadedAt = +new Date;
var interval = setInterval(function () {
var res = +new Date - loadedAt;
if (res > 1000) {
clearInterval(interval);
// Try launching the website which will navigate you into the app store
window.location.href = webUrl;
}
}, 250);
// Try launching the app using URL schemes
window.location.href = appUrl;
}
在 iOS v13 之前一切正常。现在,如果用户访问我的网站,那么将在手机上打开第一个本机应用程序,然后使用此应用程序打开应用商店。知道如何解决这个问题吗?
解决方案
推荐阅读
- mongodb - Mongo 容器无法运行 mongo 服务器
- php - 如何在laravel的电子邮件中将excel文件作为附件发送?
- java - 在 Java 中进行了 Sentry 集成,如下所示。在 Sentry 仪表板上没有收到单个事件。可能是什么原因?
- javascript - 如何在本地访问 Node.JS 项目?
- c++ - 如何将 std::iota 与 std::pair 一起使用?
- php - PHP - file_get_contents 无法打开流:即使文件路径正确,也没有这样的文件或目录
- mv - 为什么SpringMVC不能用包名“converter”配置自定义类型转换器
- c# - “System.Data.SqlClient.SqlException”:关键字“CREATE”附近的语法不正确
- import - python用户界面,thony和pycharm中的导入错误
- c# - Winforms 中的 Parasolid 查看器