This document is for developers who need to upgrade their PhoneGap-based projects to a newer PhoneGap version. Starting with PhoneGap 1.4.0, PhoneGap has been re-factored to use Cleaver (PhoneGap as a Component), and some classes that were used before have been deprecated - namely PhoneGapDelegate and PhoneGapViewController.
Your existing 1.3.0 based projects will still work with 1.4.0, but it is recommended that you upgrade, since the classes mentioned above will be removed in a future version.
-
Install PhoneGap 1.4.0
-
Make a backup of AppDelegate.m and AppDelegate.h in your project
-
Create a new project - you will have to grab assets from this new project
-
Copy these files from the new project into your 1.3.0 based project folder on disk, replacing any old files (backup your files first from step 1 above):
AppDelegate.h AppDelegate.m MainViewController.h MainViewController.m MainViewController.xib
-
Add all the MainViewController files into your Xcode project
-
Copy the www/phonegap-1.4.0.js file from the new project into your www folder, and delete your www/phonegap-1.3.0.js file
-
Update the PhoneGap script reference in your www/index.html file (and any other files that contain the script reference) to point to the new phonegap-1.4.0.js file
-
Add a new entry under Plugins in your PhoneGap.plist file - key is com.phonegap.battery and the value is PGBattery
-
Integrate any project specific code that you have in your backed-up AppDelegate.h and AppDelegate.m into the new AppDelegate files