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
Describe the bug
If you open (view) a file from another app, the app won't trigger the same event as the share feature.
To Reproduce
Steps to reproduce the behavior: Open (not share!) e.g. a .pdf file using a file explorer. (I used total commander)
Expected behavior
Either not being able to view a document using the app at all or handling viewing of a document like sharing a document with the app.
Device Information:
Device: OnePlus 8T
OS: Android 13
Paperless Mobile version 2.0.9
Paperless Server version 1.12.2
Additional context
I already did some debugging:
As the Manifest.xml includes not only android.intent.action.SEND but also android.intent.action.VIEW intents (AndroidManifest.xml:53-62) for all file types a user can "open" pdfs with the app. However only send intents are captured using ReceiveSharingIntent.getMediaStream() and ReceiveSharingIntent.getInitialMedia() (main.dart:284-288). To capture/listen for view intents ReceiveSharingIntent.getInitialText() and ReceiveSharingIntent.getTextStream() must be used. The only Problem being with those events is, they only include URIs to the opened file. So in order to use them they must be opened prior to the upload which makes it incompatible with the handling of SharedMediaFile in the share_intent_queue.dart (share_intent_queue.dart).
As I only took a quick look into this project I cannot estimate how difficult an implementation would be by using those URIs when viewing files within the app. So my suggestion would be to either remove the VIEW intents or handle the URIs using the methods outlined above.
It just left my puzzling why the "sharing" did not work as I confused it with the "viewing" of the file at first. Before diving deeper I assumed sharing/viewing is not working at all.
The text was updated successfully, but these errors were encountered:
Describe the bug
If you open (view) a file from another app, the app won't trigger the same event as the share feature.
To Reproduce
Steps to reproduce the behavior: Open (not share!) e.g. a .pdf file using a file explorer. (I used total commander)
Expected behavior
Either not being able to view a document using the app at all or handling viewing of a document like sharing a document with the app.
Device Information:
Additional context
I already did some debugging:
As the Manifest.xml includes not only
android.intent.action.SEND
but alsoandroid.intent.action.VIEW
intents (AndroidManifest.xml:53-62) for all file types a user can "open" pdfs with the app. However only send intents are captured usingReceiveSharingIntent.getMediaStream()
andReceiveSharingIntent.getInitialMedia()
(main.dart:284-288). To capture/listen for view intentsReceiveSharingIntent.getInitialText()
andReceiveSharingIntent.getTextStream()
must be used. The only Problem being with those events is, they only include URIs to the opened file. So in order to use them they must be opened prior to the upload which makes it incompatible with the handling ofSharedMediaFile
in theshare_intent_queue.dart
(share_intent_queue.dart).As I only took a quick look into this project I cannot estimate how difficult an implementation would be by using those URIs when viewing files within the app. So my suggestion would be to either remove the
VIEW
intents or handle the URIs using the methods outlined above.It just left my puzzling why the "sharing" did not work as I confused it with the "viewing" of the file at first. Before diving deeper I assumed sharing/viewing is not working at all.
The text was updated successfully, but these errors were encountered: