ios controller内加拦截器 controller: [图片][图片] - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { printf("\n======================\n"); NSString *absoluteString = [navigationAction.request.URL.absoluteString stringByRemovingPercentEncoding]; NSURLRequest *request = navigationAction.request; NSString *scheme = [request.URL scheme]; if (![scheme isEqualToString:@"https"] && ![scheme isEqualToString:@"http"]) { printf("\n跳转微信\n"); if ([scheme isEqualToString:@"weixin"]) { decisionHandler(WKNavigationActionPolicyCancel); BOOL canOpen = [[UIApplication sharedApplication] canOpenURL:request.URL]; if (canOpen) { [[UIApplication sharedApplication] openURL:request.URL]; } return; } decisionHandler(WKNavigationActionPolicyAllow); }else{ decisionHandler(WKNavigationActionPolicyAllow); } }
h5微信支付苹果手机中白屏h5发起微信支付,打包成app白屏,怎么回事,安卓手机没问题,浏览器中支付也没问题,就是在苹果app中白屏,不能跳到支付页面,过几秒钟后自动转到中间页面上去了没有支付。
2021-01-11