美文网首页
iOS webview拉起微信支付宝支付h5界面

iOS webview拉起微信支付宝支付h5界面

作者: 一曲大风歌无尽 | 来源:发表于2017-11-09 17:06 被阅读0次

webview里拦截url

requesting是url的absultestring

if ([requestString containsString:@"weixin://"]) {//支付宝是alipays://

NSRange range = [requestString rangeOfString:@"weixin://"]; //截取的字符串起始位置

NSString * resultStr = [requestString substringFromIndex:range.location]; //截取字符串

NSURL *weixinURL = [NSURL URLWithString:resultStr];

[[UIApplication sharedApplication] openURL:weixinURL options:@{UIApplicationOpenURLOptionUniversalLinksOnly: @NO} completionHandler:^(BOOL success) {

}];

}

相关文章

网友评论

      本文标题:iOS webview拉起微信支付宝支付h5界面

      本文链接:https://www.haomeiwen.com/subject/pikmmxtx.html