darryncampbell / darryncampbell-cordova-plugin-intent

General purpose intent shim layer for cordova appliations on Android. Handles various techniques for sending and receiving intents.
MIT License
86 stars 130 forks source link

Get file's name and size #104

Closed ThomasKientz closed 4 years ago

ThomasKientz commented 4 years ago

Hi,

Would it be possible to get the files' name and size with onIntent() ?

ThomasKientz commented 4 years ago

File's name is not always included in the path eg :

Shared from Files app in Android X

content://com.android.providers.media.documents/document/image%3A26

Shared from Photos

content://com.google.android.apps.photos.contentprovider/-1/1/file%3A%2F%2F%2Fdata%2Fuser%2F0%2Fcom.google.android.apps.photos%2Fcache%2Fshare-cache%2Fmedia.tmp%3Ffilename%3D589px-Topi_(Damaliscus_lunatus_jimela)_female.jpg/ORIGINAL/NONE/1980346294

darryncampbell commented 4 years ago

That is not possible with this plugin, the onIntent() just maps to https://developer.android.com/reference/android/app/Activity#onNewIntent(android.content.Intent) and should return a JSON representation of the Intent parameter. Converting the content provider to a file name & size should be done in the app or with another plugin.