- PhoneGap is Cordova? Wait…what?
- Starting Your Application – Where to begin
- Preparing to Develop with Push Notifications
- Modify PhoneGap Code
- Register Device for Push – Get Token
- Send the Token to the Server
- How to Send a Push
- How to Handle a Push
- The App is Closed
- The App is Open
PhoneGap is Cordova? Wait…what?
Just so you know, PhoneGap has been accepted into the Apache Software Foundation for incubation as Apache Cordova, where it will remain free and open source. This will ensure open, independent stewardship of the project over the long term. More information on the Apache Cordova project can be found here: http://incubator.apache.org/cordova/
At the time of writing (July 2012), there is no difference between Cordova and PhoneGap, eventually the relationship between Cordova and PhoneGap will be analogous to WebKit and Chrome/Safari. Cordova (as an open source Apache project) will provide the core functionality and PhoneGap will extend it with other plugins and support, etc.
Tip: When searching for help with PhoneGap, try searching with PhoneGap in the query and then with Cordova.
PhoneGap Push Notification Plugin
This section serves as a general background to PhoneGap plugins. It won’t tell you completely how to write a plugin on your own, but it will give you a good idea of how they work so you understand what the push plugin is doing for you.
Starting Your Application – Where to begin
The Apache Cordova project has a well documented API and reference for starting all forms of PhoneGap projects at http://phonegap.com/start. The tutorial on this site will discuss only two platforms: iOS and Android. To get started, you should follow the detailed, step-by-step explanation (with screenshots) at the Apache Cordova site.
Adding Push to Your Application
You have made it this far, now it is time to actually implement push. We have documentation on both iOS and Android and code snippets ready to be copied into your project. We’ve tried to minimize the amount of native code you need to be exposed to.