-
Notifications
You must be signed in to change notification settings - Fork 1.9k
PushNotification not defined #21
Comments
@FernandoMedin that's not the correct plugin ID. The plugin ID for this package is "phonegap-plugin-push". If you are running the PhoneGap 5.0 command line then doing a:
it will setup your config.xml for you. Let me know if this doesn't resolve things for you. |
@macdonst thanks for the reply! But, I'm getting the same error. I just tested using phonegap-build. Should I use the command line to build the app? Thanks. |
@FernandoMedin I don't think the plugin has been uploaded to PhoneGap Build. If you are using PhoneGap/Cordova CLI 5+ then:
Substitue ios for android if you want to test iOS. |
@macdonst, that works! The problem was with phonegap build so. Anyway, thank you very much! Any ideia if the plugin will be available in phonegap build? |
@FernandoMedin I'm going to close this issue then as you have a work around. I'm off this week but putting in a few bug fixes as I have time. Hope to have the next version on PG Build be early next week. I'll create an issue for it. |
Is this module in phonegap build yet? I have tried phonegap build and PushNotification is undefined. |
@macdonst Thanks. It works nicely with phonegap build. Just to benefit anyone who has the same issue and ends up here. What I did wrong was that I should manually bootstrap Angular in the "deviceready" callback, like this: angular.module("myApp", [ ... ]);
angular.element(document).ready(function () {
if (window.cordova) {
document.addEventListener('deviceready', function () {
angular.bootstrap(document, ['myApp']);
}, false);
} else {
angular.bootstrap(document, ['myApp']);
}
}); And the "ng-app" tag need to be removed from the index.html to prevent auto bootstrap. |
This thread has been automatically locked. |
Hi. Using almost the same code in example e got an error message saying that. I got this errro puting a Try before "var push".
The code:
"""
try{
var push = PushNotification.init({
"android": { "senderID": "xxxxx" }
});
}catch(err){
alert("Error: " + err.message);
}
"""
In config XML I've add the lines:
"""
feature name="PushNotification"
param name="android-package" value="com.adobe.phonegap.push.PushPlugin"/
/feature
"""
I'm doing something wrong? Thanks.
The text was updated successfully, but these errors were encountered: