Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ported to latest Phonegap / Cordova #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<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"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<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="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin
bin
gen
13 changes: 4 additions & 9 deletions assets/www/C2DMPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -49,12 +49,7 @@ C2DM.prototype.unregister = function( successCallback, failureCallback ) {
*/


PhoneGap.addConstructor(function() {
cordova.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");
cordova.addPlugin('C2DM', new C2DM());
});
Loading