Using cordova plugins
Closed this issue · 10 comments
I've installed the cordova camera plugin with:
ember cordova plugin add org.apache.cordova.camera
However when I try to call the function in JS to open the camera I get undefined for navigator.camera
.
Is there anything special I have to do to make this work?
try cordova-plugin-camera example:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(navigator.camera);
}
I tested here and worked fine! your code wait deviceready?
Yeah my deviceready isn't firing as shown in the screenshot below. I am using the iOS simulator and debugging through Safari remote debugger.
Any idea why this might be happening?
Also @dukex if you could share the code where you go it working, that would really help me out thanks :)
Problem solved. Plugins weren't working with live reload turned on.
This was fixed on master by #137. If you change the dependency ember-cli-cordova to point to master then live reload will work again with plugins.
@DanielOchoa maybe it's time to bump the version, so people with fresh installs won't have this issue.
Change ember-cli-cordova to
"ember-cli-cordova": "poetic/ember-cli-cordova#master",
or
"ember-cli-cordova": "https://github.com/poetic/ember-cli-cordova.git#master",
@dukex Too be honest I don't understand why that would produce different results. Thanks though :)
@DanielOchoa thanks