-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
DestinationType.NATIVE_URI returns content URI on Android. #404
Comments
Can you share your code? |
<plugin name="cordova-plugin-camera" spec="^4.0.2" />
<engine name="android" spec="^7.0.0" /> _chooseFromGallery() {
navigator.camera.getPicture(
this. _addPhoto.bind(this),
this._onError, {
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
destinationType: Camera.DestinationType.NATIVE_URL,
encodingType: Camera.EncodingType.JPEG,
});
} And this is the console output: |
I checked latest code in master, and I found that |
@sohrabtaee another note, try to use Destination type constants are defined as follows:
|
Hi @hazems Thanks for taking the time to review this bug. Unfortunately, when I changed Note that it works fine when I take a photo using the camera. |
This is weird, what is the device model and Android OS version does it has? |
I have tested on Galaxy S9 with both Android 8 and 9, but our customers have tested it with some other Android devices and the results were the same. |
I also experience this issue... |
Closing as native_uri return type was removed on 5.0.0 |
DestinationType.NATIVE_URI returns content URI on Android which results in this error:
Not allowed to load local resource: content://com.android.providers.media.documents/document/image%3A6770
I had to use
cordova-plugin-filepath
to get the real native URI.Stack overflow issue can be found here:
https://stackoverflow.com/questions/54088732/cordova-camera-plugin-not-allowed-to-load-local-resource-content
The text was updated successfully, but these errors were encountered: