想在app中webview页面跳转回来app特定页面,目前通过url scheme这种方式:https://uniapp.dcloud.net.cn/tutorial/app-ios-schemes.html,安卓是可以成功跳转,但是ios不行,猜测原因是在ios系统,尽管是在app中的webview页面,但是仍然是处于当前app中,而安卓系统则不认为处于当前app,目前想知道如果ios中url scheme这种方式不行,还有没有别的方式可以实现在app的webview中跳转回来app

1***@qq.com
- 发布:2025-05-21 11:25
- 更新:2025-07-15 23:58
- 阅读:1914
2 个回复
DCloud_UNI_yuhe
<web-view> 加载的网页中支持调用部分 uni 接口
, 你可以通过调用uni的方法,跳到别的页面,是不是就回到了app 了[https://uniapp.dcloud.net.cn/component/web-view.html#web-view](https://uniapp.dcloud.net.cn/component/web-view.html#web-view
)
w***@qq.com
ios 你那边能跳回去吗?伙计,还是换了种实现方式
1***@qq.com (作者)
实现了,上面那个官方回复的人一看就是菜鸡,都不知道怎么进去的,都不知道别人在说啥
if (platform == 'ios') {
plus.globalEvent.addEventListener('newintent', (e) => {
var args = plus.runtime.arguments;
if (args) {
uni.redirectTo({
url: args.split(":/")[1]
})
}
});
} else {
var args = plus.runtime.arguments;
if (args) {
uni.redirectTo({
url: args.split(":/")[1]
})
}
}
这样就行,ios和安卓不一样
2025-08-12 16:13