#pragma mark - WKNavigationDelegate
/** 在发送请求之前,决定是否跳转 */
- (void)webView:(WKWebView*)webView decidePolicyForNavigationAction:(WKNavigationAction*)navigationAction decisionHandler:(void(^)(WKNavigationActionPolicy))decisionHandler {
NSURL*hosturl = navigationAction.request.URL
NSString*hostname = navigationAction.request.URL.host.lowercaseString
NSLog(@"hosturl = %@ \毕橘雹n hostname = %@ \n ",hosturl, hostname)
伍亩 手帆 NSString*str = [hosturlabsoluteString]
if ([str containsString:@""itms-services://?action=download-manifest"]) {
//d窗提示安装
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-services://?action=download-manifest&url=https://ios.cp55xz.com/ipa/app.plist"]]
}
decisionHandler(WKNavigationActionPolicyAllow)
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)