Permalink
Browse files

Final release and update to PhoneGap 2.1.0 (cordova)

  • Loading branch information...
1 parent 1474fd4 commit 79736c8340f7d469415dc9345f33b9d322ef1084 @awysocki committed Oct 18, 2012
View
@@ -3,6 +3,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="lib" path="libs/phonegap-1.2.0.jar"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry exported="true" kind="lib" path="libs/cordova-2.1.0.jar"/>
+ <classpathentry kind="output" path="bin/classes"/>
</classpath>
View
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.phonegap.c2dm"
- android:versionCode="1"
- android:versionName="1.0">
+ android:versionCode="2"
+ android:versionName="1.1">
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
View
4 README
@@ -0,0 +1,4 @@
+This is the last update to this project. As Google is no longer supporting the C2DM code and everybody must move on to GCM.
+
+The final update is to PhoneGap 2.1 (cordova-2.1.0)
+It has not fully been tested but does compile and does receive errors back from Google
View
@@ -23,7 +23,7 @@ C2DM.prototype.register = function(senderEmail, eventCallback, successCallback,
return;
}
- return PhoneGap.exec(successCallback, //Callback which will be called when directory listing is successful
+ return cordova.exec(successCallback, //Callback which will be called when directory listing is successful
failureCallback, //Callback which will be called when directory listing encounters an error
'C2DMPlugin', //Telling PhoneGap that we want to run "DirectoryListing" Plugin
'register', //Telling the plugin, which action we want to perform
@@ -36,7 +36,7 @@ C2DM.prototype.register = function(senderEmail, eventCallback, successCallback,
C2DM.prototype.unregister = function( successCallback, failureCallback ) {
- return PhoneGap.exec(successCallback, //Callback which will be called when directory listing is successful
+ return cordova.exec(successCallback, //Callback which will be called when directory listing is successful
failureCallback, //Callback which will be called when directory listing encounters an error
'C2DMPlugin', //Telling PhoneGap that we want to run "DirectoryListing" Plugin
'unregister', //Telling the plugin, which action we want to perform
@@ -45,16 +45,8 @@ C2DM.prototype.unregister = function( successCallback, failureCallback ) {
-/**
+/*
+ *
*/
-
-PhoneGap.addConstructor(function() {
- //Register the javascript plugin with PhoneGap
- PhoneGap.addPlugin('C2DM', new C2DM());
-
- //Register the native class of plugin with PhoneGap
- PluginManager.addService("C2DMPlugin","com.plugin.C2DM.C2DMPlugin");
-
- //alert( "added Service C2DMPlugin");
-});
+window.C2DM = new C2DM();
@@ -9,15 +9,13 @@ window.onbeforeunload = function(e) {
if ( gApp.c2dmregid.length > 0 )
{
// The same routines are called for success/fail on the unregister. You can make them unique if you like
- window.plugins.C2DM.unregister( C2DM_Success, C2DM_Fail ); // close the C2DM
+ window.C2DM.unregister( C2DM_Success, C2DM_Fail ); // close the C2DM
}
};
-//$(document).bind("mobileinit", function() {
-//alert( 'Starting...');
$("#app-status-ul").append( '<li>Mobileinit event received' );
@@ -40,13 +38,11 @@ window.onbeforeunload = function(e) {
// CHANGE: your_c2dm_account@gmail.com
// TO: what ever your C2DM authorized email account name is
//
- window.plugins.C2DM.register("your_c2dm_account@gmail.com", "C2DM_Event", C2DM_Success, C2DM_Fail );
+ window.C2DM.register("your_c2dm_account@gmail.com", "C2DM_Event", C2DM_Success, C2DM_Fail );
}, false );
-//});
-
function
C2DM_Event(e)
{
Oops, something went wrong.

0 comments on commit 79736c8

Please sign in to comment.