在ios 13中,WKWebView不适用于从远程URL加载PDF
我正在使用远程URL在webview中显示pdf文件。ios 12中的UIWebView可以正常工作。 但是,在iOS 13中显示了空白页面。我还尝试了WKWebview。iOS 12和iOS 13都显示空白页。我的pdf url不是.pdf扩展名 看起来像 这是我的密码在ios 13中,WKWebView不适用于从远程URL加载PDF,ios,objective-c,pdf,wkwebview,Ios,Objective C,Pdf,Wkwebview,我正在使用远程URL在webview中显示pdf文件。ios 12中的UIWebView可以正常工作。 但是,在iOS 13中显示了空白页面。我还尝试了WKWebview。iOS 12和iOS 13都显示空白页。我的pdf url不是.pdf扩展名 看起来像 这是我的密码 NSString *body = [NSString stringWithFormat:@"docno=%@&doctype=%@&atch=%@&fname=%@&empc
NSString *body = [NSString stringWithFormat:@"docno=%@&doctype=%@&atch=%@&fname=%@&empcode=%@", gStrTranId,gStrTranNo,gStrAttachmentType,gStrFileName,gStrUserCode];
body = [body stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
NSURL *aUrl = [NSURL URLWithString:[NSString stringWithFormat:@"https://xxx.xxx.xxx.xxx/MYTASKS4/filedownload.ashx?%@",body]];
NSMutableURLRequest *request = [NSMutableURLRequest new];
NSDictionary *customHeaders = @{@"Authorization": [NSString stringWithFormat:@"Bearer %@",[SESSION getKeyValue]] , @"auth_key": [NSString stringWithFormat:@"Bearer %@",[SESSION getAuthorizeCode]], @"Content-Type": @"text/xml; charset=utf-8" };
// set the new headers
for(NSString *key in [customHeaders allKeys]){
[request addValue:[customHeaders objectForKey:key] forHTTPHeaderField:key];
}
[request setHTTPMethod:@"POST"];
[request setURL:aUrl];
self.myWebView1.navigationDelegate = self;
self.myWebView1.autoresizingMask = UIViewAutoresizingFlexibleHeight;
[self.myWebView1 loadRequest:request];
我也面临同样的问题,如果你得到了解决方案,请发布答案。我也面临同样的问题,如果你得到了解决方案,请发布答案。