Red-Folder / Cordova-Plugin-BackgroundService

BackroundService plugin for use with Cordova (PhoneGap)
144 stars 85 forks source link

Instantiate plugin with Phonegap #29

Closed danfreib closed 10 years ago

danfreib commented 10 years ago

Hello,

I've been following a tutorial to install and use this plugin for Phonegap 3.2 using the 3.1 version of your plugin. I've tried to install it and am now working on debugging it to get it running. The problem I'm having is in the line:

app.service = cordova.require('cordova/plugin/myService');

The above code works (at least doesn't error out at that specific line--the service still isn't running but I assume there are other problems) if I include cordova.js on my index.html, but not if I include phonegap.js. One of my other plugins (notifications plugin from phonegap) breaks if I use the Cordova.js file instead of the phonegap one. Do you know what to replace the code with? I tried:

app.service = phonegap.require('phonegap/plugin/myService');

like you have in your demo index.html, but when I try I get a reference error, "phonegap is not defined"

Thanks!

_EDIT_

I forgot to mention that if I use phonegap.js, the specific error is "module cordova/plugin/myService not found"

Red-Folder commented 10 years ago

I'm afraid I've no idea how to work with Phonegap variant - to be honest, until you logged this issue I didn't know there was a variant.

If you have any joy, let me know and I'll feed it back into the development (if needed)

Red-Folder commented 10 years ago

No further comments made to this issue, thus closing. If still a problem then please re-open.