-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
No result with mediaType SAVEDPHOTOALBUM and enabled CameraUsesGeolocation (iOS) #702
Comments
I have created a very easy to run example that demonstrates the non working behavior:
Verify selecting an image works. In the simulator, click the Photo Library button, choose an image and then notice the image is shown and a popup comes up with some partial exif info. Now to break everything then CameraUsesGeolocation to true in
click the Photo Library button, choose a photo and notice nothing happens. Neither the success or error callbacks get executed for navigator.camera.getPicture() Bonus points:
and run the project Notice the same behavior and the following message is shown in the console when nothing happens:
|
Same here. Callback onSuccess is never called when using mediaType SAVEDPHOTOALBUM with enabled CameraUsesGeolocation preference setting. Options:
Environment, Platform, Device Version information |
Have you tried installing the modified plugin? |
Unfortunately, https://github.com/codeconsole/cordova-plugin-camera.git#ryaa (cordova-plugin-camera 5.0.2-dev) doesn't work either. Callback onSuccess is never called. |
you tried the ryaa branch (master is just the same as the fork)? |
Having the same issue with: success callback is never called when sourceType is navigator.camera.PictureSourceType.SAVEDPHOTOALBUM The image select comes up, and can pick an image, but then nothing. sourceType navigator.camera.DestinationType.FILE_URI works fine. |
I am unable to reproduce this issue with the current master branch. I will close out this issue as unreproducible. If you are still experiencing the issue with master branch, please create a new ticket and:
Code Sample:Simple JavaScript document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
// encodingType: Camera.EncodingType.JPEG,
const cameraOptions = {
quality: 100,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM,
mediaType: Camera.MediaType.PICTURE,
saveToPhotoAlbum: false
}
function onSuccess(result) {
var image = document.getElementById('myImage');
image.src = result;
}
function onFail(message) {
alert('Failed because: ' + message);
}
document.getElementById('cameraTakePhoto').onclick = function() {
navigator.camera.getPicture(onSuccess, onFail, cameraOptions);
};
} iOS <platform name="ios">
<preference name="CameraUsesGeolocation" value="true" />
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
<string>need camera access to take pictures</string>
</edit-config>
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
<string>need photo library access to get pictures from there</string>
</edit-config>
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>
<edit-config target="NSPhotoLibraryAddUsageDescription" file="*-Info.plist" mode="merge">
<string>need photo library access to save pictures there</string>
</edit-config>
</platform> |
Bug Report
Problem
getPicture does not return an image when using mediaType SAVEDPHOTOALBUM with enabled CameraUsesGeolocation preference setting.
What is expected to happen?
When selecting an image from the camera roll and enabled CameraUsesGeolocation preference setting, the image should be returned from the plugin.
What does actually happen?
The function returns a promise, which will never be completed.
Information
When setting the CameraUsesGeolocation setting to false, the plugin works as expected, but I have an application, where the user is able to select both options.
Command or Code
Environment, Platform, Device
Cordova 10.0.0
iOS Platform 6.1.1
iPhone OS 14.3
Version information
Ionic 1.3.4
Xcode 12.3
Checklist
The text was updated successfully, but these errors were encountered: