項目中需要用到返回的html5代碼進(jìn)行銀聯(lián)支付 請求體中含有一個
notifyUrl 攔截notifyUrl 只要簡單的與UIWebview 一個代理吏祸,就可以判定結(jié)果
{- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
NSURL *URL = request.URL;
NSString *urlStr = URL.absoluteString;
// NSString *scheme = [URL scheme];
NSLog(@"我要看看我要看看我要看看—————————————————————————————— %@",URL);
if([urlStr rangeOfString:@"www.baidu.com"].location!=NSNotFound)
//_roaldSearchText
{
//支付成功后 跳到指定頁面
[self.navigationController popToRootViewControllerAnimated:NO];
return NO;
}
else
{
return YES;
}
return NO;
}
}
這個@"www.baidu.com" 就是請體中的url