-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sharing PDF on IOS fails - file received but doesnot exists #141
Comments
i've fired in a PR to try and fix this issue (#137) try adding this to your pubspec.yaml file...
|
Hi, did you find a solution? |
Does it fix PDF opening on iOS? |
@petodavid Yes, that pull request fixes the PDF opening issue on iOS. If you see the changes, @LazyDave76 did a brilliant hack on removing the "file://" prefix on the file path. |
Thank you @LazyDave76 for your fix. It works for me to open xml files. Is there any chance to see that fix in the next release on pub.dev? |
@KasemJaffer needs to merge this PR or copy my change into master before it will be released. Have asked for it to be merged again. |
1 similar comment
@KasemJaffer needs to merge this PR or copy my change into master before it will be released. Have asked for it to be merged again. |
I'm running into this now. I have modified the SharedMediaFile path entry to remove the leading "file://", but it still can't open the PDF file. flutter: FileSystemException: Cannot retrieve length of file, path = '/private/var/mobile/Containers/Shared/AppGroup/25C349AB-60EA-43FB-8C2E-F9B79F16530A/Screenshot%202021-03-22%20at%2014.13.28.pdf' (OS Error: No such file or directory, errno = 2) Did you solve it in the end? |
No I didn't |
Ok fixed it - it's because flutter doesn't like the path to be URL encoded, but iOS typically does (or this package does convert), so my workaround was to decode the URL encoding manually before trying to open the file, that works. |
Wow, this is amazingly ugly. Does this mean, I have to make two hard coded changes to the URL and also wrap this logic into a block that is only executed if the platform is iOS? And all this only for PDF files? Have you also tried #37? Does it work? Or is it even worth changing to the |
See more info in https://stackoverflow.com/questions/66256974/receive-share-file-intents-with-flutter-with-ios
When sharing a PDF file,
I was able to receive the file intent in the App but couldn't open the file:
print("$path, exist ${await io.File(path).exists()}");
I was able to print the path but the
exists
method return falseNOTE:
The text was updated successfully, but these errors were encountered: