Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ios 13中,WKWebView不适用于从远程URL加载PDF_Ios_Objective C_Pdf_Wkwebview - Fatal编程技术网

在ios 13中,WKWebView不适用于从远程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

我正在使用远程URL在webview中显示pdf文件。ios 12中的UIWebView可以正常工作。 但是,在iOS 13中显示了空白页面。我还尝试了WKWebview。iOS 12和iOS 13都显示空白页。我的pdf url不是.pdf扩展名

看起来像

这是我的密码

     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];

我也面临同样的问题,如果你得到了解决方案,请发布答案。我也面临同样的问题,如果你得到了解决方案,请发布答案。