brianleroux / phonegap-plugin-hello

A PhoneGap Plugin hello world example.
11 stars 3 forks source link

.addService() in .addConstructor() change needed? #1

Closed libbybaldwin closed 13 years ago

libbybaldwin commented 13 years ago

Hi Brian. Thanks for writing this up - so helpful to new plugin writers.

To get this plugin to work, I had to change: navigator.app.addService('HelloWorld','com.phonegap.plugin.HelloWorld'); to: PluginManager.addService('HelloWorld','com.phonegap.plugin.HelloWorld'); (which I merely copied from the Barcode Scanner plugin).

Could you confirm and/or explain the above (again, newbie needs to know)?

Also, something minor, in hello.js: var hello = function(name, win, fail) { In README.md: navigator.hello = function(name, win, fail) {

Thanks, Libby

brianleroux commented 13 years ago

hmm. what ver of phonegap/android are you using? think it might be older than mine...

libbybaldwin commented 13 years ago

0.9.4. Did things change a lot in 0.9.5. ? I just downloaded and tried it (the existing phonegap.js file from framework/assets/www) - with disastrous results.

libbybaldwin commented 13 years ago

Scratch disastrous results. I'm still making sure my 0.9.5 install is correct. Sounds like your code is for 0.9.5 only.

libbybaldwin commented 13 years ago

Confirmed - my issue is 0.9.5 vs 0.9.4. Your example here works on 0.9.5.

brianleroux commented 13 years ago

Cool --- ya, we're move fast. 0.9.5 download should be out tmrw. =)