Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

移动端调起APP钱包后无法判断用户取消交易 #41

Open
YanYuanFE opened this issue Jun 2, 2018 · 4 comments
Open

移动端调起APP钱包后无法判断用户取消交易 #41

YanYuanFE opened this issue Jun 2, 2018 · 4 comments

Comments

@YanYuanFE
Copy link

如题,希望取消交易可以不返回交易ID

@yupnano
Copy link
Contributor

yupnano commented Jun 2, 2018

交易ID是页面发起交易的时候就生成的,跟钱包APP无关。
并且用户后续的操作可能是多样的,这个很难判断,比如拒绝跳转App,跳转后直接退出钱包app,跳转后取消该交易。

@david5515
Copy link

我的做法,在页面上添加如下代码
// 监听nebulas的webExtensionWallet操作 window.addEventListener('message', function(e) { //console.log("当前的操作信息是: " + JSON.stringify(e.data)); if(e.data.resp == "Error: Transaction rejected by user"){ // 取消后的处理 } });
应该能起作用,你试试

@yupnano
Copy link
Contributor

yupnano commented Jun 20, 2018

@david5515 移动端这样做没用的,移动端兼听不到消息。

@cssmagic
Copy link
Contributor

cssmagic commented Jul 7, 2018

在手机端,钱包 App 与浏览器网页无法双向通信,因此应用只能询问用户是如何操作的,然后进入不同的流程。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants