crisp-sdk-android
crisp-sdk-android copied to clipboard
Selecting photo from gallery, not sending anything after selection
When I select photo from Gallery, image is not sending. Screenshot attached.

Crisp SDK version - 1.0.13 OS Version: Android 12
Hi @osman-teamswork and thank you for your feedback.
Could you please attach me the logs from the moment you have selected the picture?
I have already encoutered this kind of issue on previous projects with Samsung or Google Photos when, despite specifying Intent.EXTRA_LOCAL_ONLY to filter only local files to avoid writing an implementation for every service in the world to download the selected content, it does not care at all and display all of its content, even if the requesting app could not access it directly...
Here is the logs you asked- log.txt
Unfortunately, Your logs does not helped me :/
I tried to reproduce it on my own with Google Photos & Drive apps.
With the Intent.EXTRA_LOCAL_ONLY option, select a photo from both apps returns an Activity.RESULT_CANCELED result, which I suppose is intended to avoid returning remote files.
However, without this option, apps behave differently... While Google Photos is still returning an Activity.RESULT_CANCELED result, Google Drive returns an Activity.RESULT_OK result with a content URI content://com.google.android.apps.docs.storage/document/ID and surprisingly, the SDK handled it well via the ContentResolver and uploaded the photo!
So maybe I should remove the local filter after all :)
Unfortunately, if your case fall into the same as Google Photos, i.e. returning an Activity.RESULT_CANCELED as if the user were hitting the back button, I can't handle it differently :/
Google Photos stores both local and remote pictures and because of that is registered for that intent with that extra. However apparently it ignores wherever calling intent has EXTRA_LOCAL_ONLY set true. If the gallery app does not support the above intent, you can show an error message to the user after checking the file length of the returned file path from gallery app.
Finally, I think I found the issue! I like when docs are not up-to-date at Google (:
Starting the intent via Intent.createChooser(intent, title) instead of just the intent itself resolved the issue and now both Google Photos & Drive apps return me an Activity.RESULT_OK with a content URI which can be used by the SDK! So bye EXTRA_LOCAL_ONLY filter :)
It will be available in the next 1.0.14 release. I will let you know when it will be published ;)
@osman-teamswork 1.0.14 implementing this feature has just been released. It can take a few hours before it will be available. I close the issue.