breautek commented on issue #367:
URL: 
https://github.com/apache/cordova-plugin-file-transfer/issues/367#issuecomment-1701331908

   > If my app downloads thisFile.pdf to my own MyApp/Sub-Folder/thisFile.pdf 
location, can my app open that file into another app PDF viewer - it should 
still work yes? 
   
   This part I'm not 100% sure, but I don't think it will work out of the box. 
The part that makes it more difficult is the fact that your file are document 
files, not a media file. (Media as in an image, video or audio).
   
   Normally if you had a image file owned by App A. App B **could** read it 
without explicit permission from App A if App B has `READ_EXTERNAL_STORAGE` or 
`READ_MEDIA_IMAGE` permission granted.
   
   However because you're working with document files, that convenience escape 
hatch is not available. In order to share document files with other apps, App A 
needs to implement something called a `ContentProvider` which can accept and 
grant read (or write) permission to App B.
   
   I could be completely wrong here.... but I believe the typical flow in that 
kind of use case is that:
   
   1. App B uses a file picker intent to open up a document tree where they may 
pick your App A's `thisFile.pdf`.
   2. This will will trigger a ContentProvider request implemented by App A 
where
   3. App A can decide to grant temporary permission to App B.
   4. App B can then read the document file to use.
   
   Cordova doesn't implement any content providers which is why I don't think 
it will just work. And I think implementing one will be difficult since the 
details of a content provider will be largely app-specific.
   
   I don't have a complete understanding on the content provider concepts in 
Android, it's not something I have actually dabbled with. But it is the 
mechanism for sharing content between apps, from what I can understand.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to