mirror of
https://github.com/lampaa/com.lampa.startapp.git
synced 2026-04-12 00:00:30 +08:00
6.1.4
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.lampa.startapp",
|
"name": "com.lampa.startapp",
|
||||||
"version": "6.1.3",
|
"version": "6.1.4",
|
||||||
"description": "Phonegap plugin for check or launch other application in android device.",
|
"description": "Phonegap plugin for check or launch other application in android device.",
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"id": "com.lampa.startapp",
|
"id": "com.lampa.startapp",
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
id="com.lampa.startapp"
|
id="com.lampa.startapp"
|
||||||
version="6.1.3">
|
version="6.1.4">
|
||||||
|
|
||||||
<name>startApp</name>
|
<name>startApp</name>
|
||||||
<description>Phonegap plugin for check or launch other application in android device.</description>
|
<description>Phonegap plugin for check or launch other application in android device.</description>
|
||||||
|
|||||||
+1
-4
@@ -1,6 +1,5 @@
|
|||||||
cordova.define("com.lampa.startapp.startapp", function(require, exports, module) {
|
|
||||||
/**
|
/**
|
||||||
com.lampa.startapp, ver. 6.1.1
|
com.lampa.startapp, ver. 6.1.4
|
||||||
https://github.com/lampaa/com.lampa.startapp
|
https://github.com/lampaa/com.lampa.startapp
|
||||||
|
|
||||||
Phonegap plugin for check or launch other application in android device (iOS support).
|
Phonegap plugin for check or launch other application in android device (iOS support).
|
||||||
@@ -88,5 +87,3 @@ module.exports = {
|
|||||||
this.getExtra(extraValue, completeCallback, errorCallback);
|
this.getExtra(extraValue, completeCallback, errorCallback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
cordova.define("com.lampa.startapp.startapp", function(require, exports, module) {
|
||||||
|
/**
|
||||||
|
com.lampa.startapp, ver. 6.1.4
|
||||||
|
https://github.com/lampaa/com.lampa.startapp
|
||||||
|
|
||||||
|
Phonegap plugin for check or launch other application in android device (iOS support).
|
||||||
|
bug tracker: https://github.com/lampaa/com.lampa.startapp/issues
|
||||||
|
*/
|
||||||
|
|
||||||
|
var exec = require('cordova/exec');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
/**
|
||||||
|
* Set application params
|
||||||
|
*
|
||||||
|
* @param {Mixed} params params, view documentation https://github.com/lampaa/com.lampa.startapp
|
||||||
|
* @param {Mixed} extra Extra fields
|
||||||
|
* @param {Function} errorCallback The callback that is called when an error occurred when the program starts.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
set: function(params, extra) {
|
||||||
|
var output = [params];
|
||||||
|
|
||||||
|
if(extra != undefined) {
|
||||||
|
output.push(extra);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
output.push(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
start: function(completeCallback, errorCallback, messageCallback) {
|
||||||
|
completeCallback = completeCallback || function() {};
|
||||||
|
errorCallback = errorCallback || function() {};
|
||||||
|
messageCallback = messageCallback || function() {};
|
||||||
|
|
||||||
|
exec(function(result) {
|
||||||
|
if(result === "OK") {
|
||||||
|
completeCallback(result);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var requestCode = result["_ACTION_requestCode_"];
|
||||||
|
delete result["_ACTION_requestCode_"];
|
||||||
|
|
||||||
|
var resultCode = result["_ACTION_resultCode_"];
|
||||||
|
delete result["_ACTION_resultCode_"];
|
||||||
|
|
||||||
|
messageCallback(result, requestCode, resultCode);
|
||||||
|
}
|
||||||
|
}, errorCallback, "startApp", "start", output);
|
||||||
|
},
|
||||||
|
check: function(completeCallback, errorCallback) {
|
||||||
|
completeCallback = completeCallback || function() {};
|
||||||
|
errorCallback = errorCallback || function() {};
|
||||||
|
|
||||||
|
exec(completeCallback, errorCallback, "startApp", "check", output);
|
||||||
|
},
|
||||||
|
receiver: function(completeCallback, errorCallback, messageCallback) {
|
||||||
|
completeCallback = completeCallback || function() {};
|
||||||
|
errorCallback = errorCallback || function() {};
|
||||||
|
messageCallback = messageCallback || function() {};
|
||||||
|
|
||||||
|
exec(function(result) {
|
||||||
|
if(/\d+/.test(result)) {
|
||||||
|
completeCallback(result);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var action = result["_ACTION_VALUE_FORMAT_"];
|
||||||
|
delete result["_ACTION_VALUE_FORMAT_"];
|
||||||
|
|
||||||
|
messageCallback(action, result);
|
||||||
|
}
|
||||||
|
}, errorCallback, "startApp", "receiver", output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* extra values
|
||||||
|
*/
|
||||||
|
getExtras: function(completeCallback, errorCallback) {
|
||||||
|
exec(completeCallback, errorCallback, "startApp", "getExtras", []);
|
||||||
|
},
|
||||||
|
getExtra: function(extraValue, completeCallback, errorCallback) {
|
||||||
|
exec(completeCallback, errorCallback, "startApp", "getExtra", [extraValue]);
|
||||||
|
},
|
||||||
|
hasExtra: function(extraValue, completeCallback, errorCallback) {
|
||||||
|
this.getExtra(extraValue, completeCallback, errorCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user