【发布时间】:2016-09-29 04:43:38
【问题描述】:
我正在尝试从支付门户确定成功的支付事件。 您可能知道这个过程:您将“回调 URL”作为其他参数之一发送到支付网站。付款后,网站会将浏览器重定向到您的“回调 URL”。
由于这是 Android 应用程序,我指定了一个带有自定义方案 ('myapp://order/123') 的自定义 URL 作为“回调 URL” 然后我使用以下技术拦截重定向到我的“回调 URL”以执行一些自定义操作。
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
LOG.info("Inside shouldOverrideUrlLoading(), url: {}", url);
if (url.startsWith("myapp://")) {
onPaymentPerformed();
return true;
} else {
return false;
}
}
}
它工作了好几个月,但最近开始失败。我不知道为什么,但可能是由于设备更新。已停止为“myapp://”url 调用此方法。我检查了日志,发现以下消息
I/chromium: [INFO:CONSOLE(2174)] "Mixed Content: The page at 'https://www.liqpay.com/en/checkout/success/xxxx' was loaded over a secure connection, but contains a form which targets an insecure endpoint 'myapp://order/7'. This endpoint should be made available over a secure connection.", source: https://static.liqpay.com/checkout/160922113118/js/index.js (2174)
然后我尝试将 'myapp://order/123' 更改为 'https://order/123' 但该 url 也没有调用方法 shouldOverrideUrlLoading() ,而是在 webview 中看到标准错误消息:
The webpage at https://order/123 could not be loaded because: net::ERR_NAME_NOT_RESOLVED
我在网上没有找到类似的东西,请帮忙
【问题讨论】: