capacitor-community / file-opener

Capacitor File Opener. The plugin is able to open a file given the mimeType and the file uri. This plugin is similar to cordova-plugin-file-opener2 without installation support.
MIT License
67 stars 13 forks source link

feat: added support for content:// paths on Android #61

Closed shiv19 closed 3 months ago

shiv19 commented 3 months ago

Adds support for content:// path on Android. When we open files on android using a file picker on newer devices, we get a content:// style path. The changes use a content resolver to open such paths.

shiv19 commented 3 months ago

@ryaa Please consider this PR :) Thanks!

ryaa commented 3 months ago

@ryaa Please consider this PR :) Thanks!

@shiv19 Thank you for the contribution. I think that it might make sense to add a guard to check if the file exits for content:// path as well - see https://github.com/shiv19/file-opener/pull/1. Please let me know your thoughts. thank you

shiv19 commented 3 months ago

@ryaa I've added a check if the file exists for content:// url :)

ryaa commented 3 months ago

@ryaa I've added a check if the file exists for content:// url :)

thank you. the changes have been merged and included into the new release v6.0.1 - see https://github.com/capacitor-community/file-opener/blob/master/CHANGELOG.md

TiBz0u commented 2 weeks ago

Hi @shiv19 Can you give an example of a usage of content:// ? Is there a plugin that gives content:// scheme as a result? Kr.

shiv19 commented 2 weeks ago

@TiBz0u We're using "@capawesome/capacitor-file-picker": "^6.0.1", To pick files. It returns content url on android.