1***@163.com
1***@163.com
  • 发布:2025-07-23 13:27
  • 更新:2025-07-23 13:40
  • 阅读:247

【报Bug】ios UrlSchemes唤起app plus.runtime.arguments无法取到值

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 15.5

HBuilderX类型: 正式

HBuilderX版本号: 4.75

手机系统: iOS

手机系统版本号: iOS 18

手机厂商: 苹果

手机机型: iphone 14

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

onShow: function () {
const options = plus.runtime.arguments
console.log('options', options)
}

// h5
<!DOCTYPE html>
<html lang="zh-CN">

<head>
<meta charset="UTF-8">
<title>打开App</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
text-align: center;
padding: 80px 20px;
}

h2 {  
  color: #333;  
}  

.btn {  
  background: #007aff;  
  color: white;  
  padding: 14px 24px;  
  border-radius: 8px;  
  font-size: 16px;  
  text-decoration: none;  
  display: inline-block;  
  margin-top: 20px;  
}  

.tip {  
  margin-top: 30px;  
  font-size: 14px;  
  color: #888;  
}  

</style>
</head>

<body>

<h2>正在打开App...</h2>
<p>若没有自动跳转,请点击下方按钮手动打开或下载 App</p>

<a class="btn" href="yijing://artGallery?id=206">手动打开 App</a>

<div class="tip">还没有安装?请点击跳转到应用市场或官网下载</div>

<script>
// 自动跳转到 App Scheme
(function () {
const start = Date.now();
// 跳转到 App 指定页面
window.location.href = 'yijing://artGallery?id=206';

})();  

</script>

</body>

</html>

操作步骤:

从浏览器点击按钮跳转到app

预期结果:

iOS也能返回 yijing://artGallery?id=206

实际结果:

ios返回的是{"name":"","path":"","query":""}

bug描述:

使用UrlSchemes通过浏览器唤起app时,ios没有拿到plus.runtime.arguments的值 android上正常
ios的值为{"name":"","path":"","query":""} android的值 yijing://artGallery?id=206

2025-07-23 13:27 负责人:无 分享
已邀请:
1***@163.com

1***@163.com (作者)

把pages.json里的condition去掉重新打包就OK了。。。

要回复问题请先登录注册