diegonetto / generator-ionic

Build hybrid mobile apps using the Ionic Framework
MIT License
1.74k stars 336 forks source link

Cordova camera plug in for ios #267

Open kraom opened 8 years ago

kraom commented 8 years ago

I am installing Cordova@6.0.0 in my mac and I have added the camera plugin also. But I don't know how to configure how To call camera plugin ios?

Note: Xcode version 7.2 Cordova version 6.0.0

Please help me!

okonon commented 8 years ago

Please look at camera plugin docs:

navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
    destinationType: Camera.DestinationType.DATA_URL
});

function onSuccess(imageData) {
    var image = document.getElementById('myImage');
    image.src = "data:image/jpeg;base64," + imageData;
}

function onFail(message) {
    alert('Failed because: ' + message);
}