-
Notifications
You must be signed in to change notification settings - Fork 2
/
webintent.js
41 lines (35 loc) · 1.08 KB
/
webintent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Phonegap Web Intent plugin
* Copyright (c) Boris Smus 2010
*
*/
var WebIntent = function() {
};
WebIntent.ACTION_SEND = "android.intent.action.SEND";
WebIntent.EXTRA_TEXT = "android.intent.extra.TEXT";
WebIntent.EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
WebIntent.prototype.startActivity = function(params, success, fail) {
return PhoneGap.exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'WebIntent', 'startActivity', [params]);
};
WebIntent.prototype.hasExtra = function(params, success, fail) {
return PhoneGap.exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'WebIntent', 'hasExtra', [params]);
};
WebIntent.prototype.getExtra = function(params, success, fail) {
return PhoneGap.exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'WebIntent', 'getExtra', [params]);
};
PhoneGap.addConstructor(function() {
PhoneGap.addPlugin('webintent', new WebIntent());
PluginManager.addService("WebIntent","com.borismus.webintent.WebIntent");
});