Currently, I am delving into the realm of app development using Phonegap and experimenting with the Phonegap push plugin available here. I am encountering an issue where the register event fails to fire even after initialization. Here are the steps I have taken:
- Created the project using Phonegap
- Installed the plugin following the provided instructions using
phonegap plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
- Built the platform with
phonegap build android
After adding the Android platform without any errors, the registration event does not trigger upon running the app. Here is a snippet of my code:
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
...
// Additional code omitted for brevity
...
};
In my index.html file, the scripts are referenced as follows:
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/push.js"></script>
<script type="text/javascript" src="js/index.js"></script>
Could there be an error in my setup? How can I confirm if the plugin is initializing correctly or why the registration event is not being triggered?