Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #709 from Patrick64/patch-1
Browse files Browse the repository at this point in the history
[WebIntent Android] Compatibility for Phonegap 2.0
  • Loading branch information
macdonst committed Aug 15, 2012
2 parents cc9a2f0 + ddd09ea commit 24212d4
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Android/WebIntent/webintent.js
@@ -1,5 +1,5 @@
/**
* Phonegap Web Intent plugin
* cordova Web Intent plugin
* Copyright (c) Boris Smus 2010
*
*/
Expand All @@ -15,31 +15,31 @@ WebIntent.EXTRA_STREAM = "android.intent.extra.STREAM";
WebIntent.EXTRA_EMAIL = "android.intent.extra.EMAIL";

WebIntent.prototype.startActivity = function(params, success, fail) {
return PhoneGap.exec(function(args) {
return cordova.exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'WebIntent', 'startActivity', [params]);
};

WebIntent.prototype.hasExtra = function(params, success, fail) {
return PhoneGap.exec(function(args) {
return cordova.exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'WebIntent', 'hasExtra', [params]);
};

WebIntent.prototype.getUri = function(success, fail) {
return PhoneGap.exec(function(args) {
return cordova.exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'WebIntent', 'getUri', []);
};

WebIntent.prototype.getExtra = function(params, success, fail) {
return PhoneGap.exec(function(args) {
return cordova.exec(function(args) {
success(args);
}, function(args) {
fail(args);
Expand All @@ -48,20 +48,24 @@ WebIntent.prototype.getExtra = function(params, success, fail) {


WebIntent.prototype.onNewIntent = function(callback) {
return PhoneGap.exec(function(args) {
return cordova.exec(function(args) {
callback(args);
}, function(args) {
}, 'WebIntent', 'onNewIntent', []);
};

WebIntent.prototype.sendBroadcast = function(params, success, fail) {
return PhoneGap.exec(function(args) {
return cordova.exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'WebIntent', 'sendBroadcast', [params]);
};

PhoneGap.addConstructor(function() {
PhoneGap.addPlugin('webintent', new WebIntent());
cordova.addConstructor(function() {
window.webintent = new WebIntent();

// backwards compatibility
window.plugins = window.plugins || {};
window.plugins.webintent = window.webintent;
});

0 comments on commit 24212d4

Please sign in to comment.