馃拪 Capacitor Doctor 馃拪
Latest Dependencies:
@capacitor/cli: 1.2.1
@capacitor/core: 1.2.1
@capacitor/android: 1.2.1
@capacitor/ios: 1.2.1
Installed Dependencies:
@capacitor/cli 1.1.0
@capacitor/android 1.2.1
@capacitor/core 1.1.0
@capacitor/ios 1.2.0
When allowEditing is true in the Camera .getPhoto call, on Android, there is no option to select the edited image. Basically you can only close the edit window and it doesn't pass the image back to JS.
Should work like iOS where you can crop etc and then continue and have the edited image returned.

let options: any = {
quality: 80,
correctOrientation: true,
allowEditing: true,
direction: CameraDirection.Front,
resultType: CameraResultType.DataUrl
};
return Camera.getPhoto(options).then(res => {
if (typeof res === 'object' && res.dataUrl) resolve(res.dataUrl);
else reject();
}).catch(() => reject());
npm --version output: 6.10.3
node --version output: v9.4.0
pod --version output (iOS issues only): ---
iOS behaviour comes with the native component, Android uses an Intent to a photo editing app. The app in your screenshot I think is google photos app and works like that, don't let you continue until you do some change to the image. If in example you tap "auto", the continue button will appear.
We can't control the photo editing app.
Isn't there an open source photo capture/edit library that could be used so that the functionality is consistent or at least usable across platforms? Also the ability to take a photo without leaving the app would eliminate a lot of complexity in terms of restoring state, etc. Relying on the raw android functionality doesn't seem to provide usability in this case. Even though you can tap auto and maybe continue appears at that point, our testers couldn't figure that out, which means that it's unusable as is.
https://github.com/CameraKit/camerakit-android
For what it's worth - this is what I ended up doing:
const image = await Camera.getPhoto({
quality: 90,
allowEditing: Capacitor.platform === 'ios',
direction: CameraDirection.Front,
source: CameraSource.Prompt,
resultType: CameraResultType.Base64,
width: 750
});
This way Android doesn't take you to some editing app, but just returns the image. iOS allows simple edits and it is straightforward. Much better experience.
Most helpful comment
For what it's worth - this is what I ended up doing:
This way Android doesn't take you to some editing app, but just returns the image. iOS allows simple edits and it is straightforward. Much better experience.