Open Firebase Storage Pdf Url In Webview
I have uploaded a Pdf file to firebase storage, after uploading the pdf file to firebase storage, I am getting the download url. Now I want to open the pdf file in webview in my an
Solution 1:
Late but you should encode your url,
try {
url=URLEncoder.encode(url,"UTF-8");
myWebView.loadUrl("https://docs.google.com/gview?embedded=true&url="+url);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Solution 2:
I think your problem when you upload the file to firebase, you should add metadata of your uploaded file in you case you should define StorageMetadata and set contentType of "application/pdf"
This code from iOS app
FIRStorageMetadata* metadata = [[FIRStorageMetadata alloc] init];
metadata.contentType = @"application/pdf";
and then when you put data to firebase add this metadata in upload function
Post a Comment for "Open Firebase Storage Pdf Url In Webview"