-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(camera)!: Use Android Photo Picker instead of ACTION_PICK intent #1833
Conversation
@jcesarmobile tested this in the Portals Ecommerce App and it seems to be working as expected. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Released dev build of camera with dev version: 5.0.8-dev-1833-20231106T142057.0 |
…ols/capacitor-plugins into ios-location-aware-camera * 'ios-location-aware-camera' of https://github.com/werktools/capacitor-plugins: (24 commits) fix(keyboard): distribute the new SPM files (ionic-team#1895) chore: only lint plugins that changed (ionic-team#1880) feat(google-maps)!: Update iOS dependencies (ionic-team#1890) chore: update Podfile paths (ionic-team#1891) chore(ios): fix verify script (ionic-team#1892) chore(release): publish [skip ci] docs(README): Update note for Capacitor 6 (ionic-team#1883) chore: update dependencies to use next tag (ionic-team#1889) chore: bump version to 6.0.0-alpha.0 (ionic-team#1888) feat(app,haptics,status-bar,keyboard): Supporting Swift Package Manager (ionic-team#1886) chore(android): upgrade gradle wrapper and plugin to 8.2.x (ionic-team#1885) refactor(ios): remove removeAllListeners methods (ionic-team#1867) feat(camera)!: Use Android Photo Picker instead of ACTION_PICK intent (ionic-team#1833) fix(share): Address Android 14 changes (ionic-team#1849) chore: Remove lerna bootstrap form scripts (ionic-team#1875) chore: fix toggle-local npm script (ionic-team#1847) feat(filesystem): add removeAllListeners method (ionic-team#1862) docs(google-maps/geolocation)!: Removing deprecated usage descriptions for iOS (ionic-team#1855) chore: use the new addListener return type (ionic-team#1846) chore: ci release dev for non-draft PR's (ionic-team#1854) ...
This does cause unknown behaviour changes and various differences to how it works depending on the Android version and device being used, including breaking the functionality for selecting multiple images on some devices, as outlined in the following issue: #2199 Due to the amount of uncertainty around how different devices/versions would be affected by this change, I think this would have benefitted from having an option for "UseLegacyMode" to allow people to not be forced to use the Android Photo Picker and continue using the previous image picker. Due to the issues outlined above it means that we cannot upgrade to this version of Capacitor until we change to use a different image picker that provides a consistent interface and functionality across different Android versions. |
Sadly Google is requiring to use the Photo Picker for apps whose main purpose isn't handling images, so there was no option for us to keep backward compatible code as it could lead to app rejections if the code was detected even if not used by all users. And sadly the Photo Picker is half backed, same thing happened when they forced to use the Android 12 Splash Screen API. You can try updating the If you still find issues you can report them to Google The deadline to not use the Photo Picker already expired, they started asking for additional information when requesting the photos permission and you have to send the information before October 31, 2024. |
@jcesarmobile Thank you for the detailed explanation as to the reasons you were forced to make this change. We tried As you mentioned it seems that the Photo Picker does need a lot of work before it is fit for purpose on all devices, there are already a lot of reported issues with Google I found from following your link. Our App is one that has been approved as having a main purpose of handling images so we are not forced to use the Photo Picker, therefore, I think the best solution for us for the time being is going to be to use a forked version of Capacitor/Camera where we have reverted back the changes forcing the use of Photo Picker, then just wait until they have brought out the relevant updates to fix the backwards compatibility issues or wait until our userbase have updated their devices to newer versions. |
Setting it as breaking because the component change might cause unknown behaviour changes.
Also because it no longer requires permissions for picking pictures from the gallery on Android.
I have not tested the changes in a fragment, so not sure if somebody with a sample app that uses fragments could test it and make sure this code is correct
https://github.com/ionic-team/capacitor-plugins/pull/1833/files#diff-40c8474750f8a1fbb312900f646eca6a86067853007cdfe292b428bf0e48bddfR322-R334
I made it similar to how
fragment.registerForActivityResult
works.