I\'m developing an App using Phonegap and Phonegap Build. The app has been pretty much completed but I\'m not working on the Push Notifications.
I\'m struggling to g
You are not using the this context correctly. This is a common mistake. The Javascript this does NOT work like the Java this.
The reason it does not work is because the this gets resolved at run-time, not assemble-time (or compile-time). When the event fires, this resolves to the the global this because your app object is now out of scope. The event fires *outside* of your app object.
A quick fix would be to do app.onDeviceReady instead of You can test this by making yourthis.onDeviceReadyonDeviceReady() a global function and leaving the this in place.
These videos should help. – Best of Luck.
Context in JavaScript - 1/4 - Purpose and Problems with JavaScript's "This"
Context in JavaScript - 2/4 - How JavaScript Decides What "This" Actually Is
Context in JavaScript - 3/4 - "This" May Not Be What You Expected & How to Fix It
Context in JavaScript - 4/4 - Mastering "This:" Additional Techniques & Future Support