hi , i have installed some plugins in my fresh ionic2 app but none of them are working
camera, toast, push result in error error cannot read property of undefined
this is what i’m doing for one of them (camera)
installation
$ ionic plugin add cordova-plugin-camera
code
`getpic(){
Camera.getPicture(onSuccess, onFail, {
quality: 50, destinationType: Camera.DestinationType.FILE_URI
});
function onSuccess(imageData){
var image = document.getElementById(‘myImage’);
image.src = imageURI
}
function onFail(message){
alert(“Failed because:” + message)
I don’t know if this will help your situation but I had a plug-in problem the other day which would only fix itself if I used the cordova plugin rather than the ionic plugin command. See here.
Doesn’t work for me… Trying to add toasts to my existing project.
Trying to test on my Nexus 5 device using ionic run android, but I could see that window.plugins is undefined
Same plugin works fine if installed in fresh typescript project. I Just cant make it work on my existing ES6 project. Trying to remove using ionic plugin remove cordova-plugin-x-toast and then reinstall by cordova plugin add cordova-plugin-x-toast but no luck… Maybe anyone knows the way to debug this?
BTW Using another plugin for scanning barcodes and it works just fine…