I'd suggest using the modern plugin tag. Also, if you don't specify a "source", "npm" is assumed, but the plugin isn't available on npm that I can see, so you'll need to reference the PGB version, like so:
<plugin name="de.appplant.cordova.plugin.background-mode" spec="0.6.4" source="pgb" />
(The deprecated gap:plugin tag defaults to PGB if no source is specified.)
When I looked up the plugin on PGB, it indicates it had recently been updated. You might want to try an alternative version (0.6.3 or the like; change the value of "spec") to see if that works.
I also noticed that PGB indicates that this plugin has a dependency on the device plugin @ 0.2.12. The current version from npm is actually @ 1.1.1. It's possible that will also cause a problem, but one step at a time.
Hey Kerrishotts, thanks for the reply.
I followed your suggestion, I tryied all versions of this plugin, but same problem in all versions, the app no build due this error message: plugin unsupported: de.appplant.cordova.plugin.background-mode @ 0.6.4
So, I change the cordova-plugin-device to <plugin name="org.apache.cordova.device" spec="0.2.12" source="pgb" />, but PhonegapBuild shows the error message: plugin unsupported: org.apache.cordova.device @ 0.2.12
Well, I tryied the new git-backed reference:
<plugin spec="katzer/cordova-plugin-background-mode.git" source="git" />
This time the PhoneGap Build try to build, but shows the following error message:
Error - Plugin error (you probably need to remove plugin files from your app): //github.com/katzer/cordova-plugin-background-mode.git": Fetching plugin "https://github.com/katzer/cordova-plugin-background-mode.git" via git clone Repository "https://github.com/katzer/cordova-plugin-background-mode.git" checked out to git ref "master". Installing "email@example.com" for ios WARNING: org.apache.cordova.device has been renamed to cordova-plugin-device. You may not be getting the latest version! We suggest you `cordova plugin rm org.apache.cordova.device` and `cordova plugin add cordova-plugin-device`. Changing plugin to "cordova-plugin-device" Fetching plugin "cordova-plugin-device" via npm Failed to install 'de.appplant.cordova.plugin.background-mode':Error: Expected plugin to have ID "org.apache.cordova.device" but got "cordova-plugin-device".at checkID (/usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/plugman/fetch.j s:177:15) at /usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/plugman/fetch.js :161:9 at _fulfilled (/usr/local/lib/node_modules/pgb-plugman/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/pgb-plugman/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/pgb-plugman/node_modules/q/q.js:749:13) at /usr/local/lib/node_modules/pgb-plugman/node_modules/q/q.js:557:44 at flush (/usr/local/lib/node_modules/pgb-plugman/node_modules/q/q.js:108:17) at doNTCallback0 (node.js:417:9) at process._tickCallback (node.js:346:13) Expected plugin to have ID "org.apache.cordova.device" but got "cordova-plugin-device".
Sorry for english mistakes,
I think you are out of luck at the moment. I suggest creating an issue at the plugin's repository so that the plugin author can address the issue. I suspect that once they update to the more recent device plugin, things will probably go more smoothly.
One other thing I feel I should point out: this plugin will keep your app out of the Apple app store, because it's abusing the background modes by pretending to play audio. Just thought you ought to be aware.
Well, I created an issue about this problem at the plugin repository and I hope the be answered, hehehe. Thanks for this suggestion.
Oh, and yes, you're right, I had some trouble about the 'Background Audio' with Apple team some months ago, but I explained the why this plugin uses this resource and the Apple team released my app at the App store.
Thank you very much!
My issue was answered!
This plugin was updated and now its on NPM repo. It´s working again!
Thanks for all help!
Can you link to your solution and mark this as answered? Thanks