poetic/ember-cli-cordova

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?

dukex commented

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.

screenshot 2015-05-11 16 37 34

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.

greis commented

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.

@greis how do I do that?

My package.json looks like this:
screenshot 2015-05-12 13 23 04

dukex commented

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 :)

dukex commented

@xypaul my examples is about @greis comment to change ember-cli-cordova to get current code from master branch not the 0.0.16 version

@greis @xypaul I've published 0.0.17 in npm. You should now be able to set your package.json to use it.