You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For context we are trying to replace os-related browser with one unique webview in our app, mostly for displaying web content.
This plugin seemed like a real good candidate, however i'm still experiencing some discrepancies here and there concerning downloads.
I have already investigated multiple threads and would like definite answers to decide if we have to keep or dismay the use of this plugin.
TLDR : download is working fine for direct access links, however we don't have a mean to recognize server-side protected document download urls all the time.
Environment
Flutter version : 3.X.X
Plugin version : 5.X.X / 6.X.X
Android version : SDK 23/Android 6+
iOS version : iOS 13+
macOS version : Monterey 12.5
Xcode version : 14.2
Device information: Multiple devices, Samsungs, iphone SE
Description
Expected behavior:
Download should be recognized and start for both a direct link to files (i.e.: .../file.pdf url) and also for server restricted access links (i.e: .../api/download/id=XXX).
Current behavior:
At the moment, the onDownloadStartRequest feedback is launching only for direct links => http..url.pdf
Whenever files are sent securely from behind the server this onDownload trigger doesn't launch.
How could one make sure the url we are trying to access is to be handled as a download.
We have the shouldOverrideUrl trigger but navigationAction request doesn't give any hint as to if the destination is a file.
We can hard-code the our download-url recognition here but it should work with any secured url from any site so that's out of the question.
Basically if(urlString.contains(download-pattern)) won't work for any site which isn't ours.
As an alternative we don't have enough informations on onLoadStop to do the same sort of things, unless i'm missing something.
Steps to reproduce
I added the useOnDownloadStart and useShouldOverrideUrlLoading true in settings
When onDownloadStart is triggered i delegate the download to my DownloadService, which works fine
For server protected URL onDownloadStart doesn't trigger. As an alternative if i identify our download URL on shouldOverrideUrl and trigger the download service manually here it does download.
However it should work for any site and as such i don't have a definitive recognition pattern.
i tried updating to the 6.X.X beta version, but even there the navigationAction.shouldPerformDownload on iOS always returns false for server protected download urls.
i seen the flutter_dowloader plugin recommended however it seems to be lagging behind after latest Android 11 permission related problems, and it is currently changing maintainers and might be discontinued.
In short : Is there an implementation-proof way of detecting download urls (especially server secured ones) ? Independent of whether the file is returned in response content, as an attache file, bytes etc ? Maybe we can get some mime-type, headers for this somewhere but i can't seem to find a solution.
Are you sure you have already searched for the same problem?
Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!
If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.
In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.
Following these steps can save you, me, and other people a lot of time, thanks!
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.
For context we are trying to replace os-related browser with one unique webview in our app, mostly for displaying web content.
This plugin seemed like a real good candidate, however i'm still experiencing some discrepancies here and there concerning downloads.
I have already investigated multiple threads and would like definite answers to decide if we have to keep or dismay the use of this plugin.
TLDR : download is working fine for direct access links, however we don't have a mean to recognize server-side protected document download urls all the time.
Environment
Flutter version : 3.X.X
Plugin version : 5.X.X / 6.X.X
Android version : SDK 23/Android 6+
iOS version : iOS 13+
macOS version : Monterey 12.5
Xcode version : 14.2
Device information: Multiple devices, Samsungs, iphone SE
Description
Expected behavior:
Download should be recognized and start for both a direct link to files (i.e.: .../file.pdf url) and also for server restricted access links (i.e: .../api/download/id=XXX).
Current behavior:
At the moment, the onDownloadStartRequest feedback is launching only for direct links => http..url.pdf
Whenever files are sent securely from behind the server this onDownload trigger doesn't launch.
How could one make sure the url we are trying to access is to be handled as a download.
We have the shouldOverrideUrl trigger but navigationAction request doesn't give any hint as to if the destination is a file.
We can hard-code the our download-url recognition here but it should work with any secured url from any site so that's out of the question.
Basically if(urlString.contains(download-pattern)) won't work for any site which isn't ours.
As an alternative we don't have enough informations on onLoadStop to do the same sort of things, unless i'm missing something.
Steps to reproduce
However it should work for any site and as such i don't have a definitive recognition pattern.
In short : Is there an implementation-proof way of detecting download urls (especially server secured ones) ? Independent of whether the file is returned in response content, as an attache file, bytes etc ? Maybe we can get some mime-type, headers for this somewhere but i can't seem to find a solution.
Related threads :
https://gist.github.com/pichillilorenzo/ee74e103fdc324f761c5fde7b73bd430
#1309
#1087
#842
The text was updated successfully, but these errors were encountered: