Reputation: 543
I'm currently trying to use the pushPlugin plugin, however when i try to initialize it, it says that 'cordova' is not defined. The cordova.js file is being included, however it 404s like it's supposed to. If that's the case, how are plugins like these supposed to work? More specifically, how would is get pushPlugin to work?
Upvotes: 0
Views: 744
Reputation: 176
For most plugins, you're right. But the purpose of this plugin is to allow a device to receive a remote notification through one of the push providers (e.g. Apple's APN or Google' GCM).
For this plugin, there is no 'fake' provider which sends messages to a desktop computer, so it cannot set up a handler to listen for them.
I normally put code like this within an 'if window.cordova' conditional so that it doesn't run on desktop. You'll need to use a real device to test this plugin's functionality properly.
Hope that's useful,
John
Upvotes: 1
Reputation: 10857
If you are testing on the desktop, this is expected. They will not work there.
Upvotes: 0