Reputation: 13
I am following this tutorial to implement Push Notifications into my PhoneGap application. However I keep getting the following error in XCode:
2014-06-03 22:50:38.425 Clubbed In[336:60b] CDVPlugin class PushPlugin (pluginName: PushPlugin) does not exist.
2014-06-03 22:50:38.425 Clubbed In[336:60b] ERROR: Plugin 'PushPlugin' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2014-06-03 22:50:38.427 Clubbed In[336:60b] -[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [
"PushPlugin1224815266",
"PushPlugin",
"register",
[
{
"alert" : "true",
"ecb" : "onNotificationAPN",
"sound" : "true",
"badge" : "true"
}
]
I have put the 4 delegate/plugin files into my project's plugin folder successfully. In addition, I have added the PushNotification.js and referenced it correctly. I also have the following feature tags in my config.xml:
<feature name="PushPlugin">
<param name="ios-package" value="PushPlugin" />
</feature>
Does anyone know why I would be getting this error? I am pretty sure that I correctly manually installed this PushPlugin.
In the plugins folder should I include a folder called com.plugin.PushPlugin, then put the 4 files within that?
Any help would truly be appreciated. I have been stuck on this problem for a long time...
Thanks!
Upvotes: 0
Views: 752
Reputation: 108
I had the same problem, but I just find the solution. I've replaced my init code with:
var pushNotification = PushNotification.init({
"android": {
"senderID": "1234567890"
},
"ios": {"alert": "true", "badge": "true", "sound": "true"},
"windows": {}
});
pushNotification.on('registration', function(data) {
console.log("registration event");
console.log(JSON.stringify(data));
});
pushNotification.on('notification', function(data) {
console.log("notification event");
console.log(JSON.stringify(data));
pushNotification.finish(function () {
console.log('finish successfully called');
});
});
pushNotification.on('error', function(e) {
console.log("push error");
});
PushPlugin not found, or is not a CDVPlugin
Upvotes: 1