Does anyone know how can i communicate with the device’s camera?
upload image
take picture
Can’t find any tutorial on this subject…
please help
Does anyone know how can i communicate with the device’s camera?
upload image
take picture
Can’t find any tutorial on this subject…
please help
import {Camera} from 'ionic-native';
Just to elaborate a bit more, you can use the ionic-native
package which is a set wrappers for cordova plugins.
You can use
npm install ionic-native --save
Then import the package
import {Camera} from 'ionic-native';
This will give you the autocompletion and make sure everything works fine.
Don’t forget to install the native plugin as well!
Hi @mhartington ,
The plugin seems to be working fine, but I am getting URI and File path while using Camera.PictureSourceType
as CAMERA and PHOTOLIBRARY
.
###following is the sample values returned for each options:
PHOTOLIBRARY : content://media/external/images/media/51519 CAMERA : file:///storage/emulated/0/Android/data/io.ionic.starter/cache/1460012636978.jpg
How to convert the PHOTLIBRARY
uri vallue to file location url?
And file location value returned from the CAMERA option is not setting up the image in image element.
You could use FileReader.readAsDataURL()
google it