Go to file
2015-12-07 16:35:07 +03:00
src Update startApp.java 2015-07-06 11:22:04 +03:00
test Merge remote-tracking branch 'origin/master' 2015-01-20 12:45:38 +03:00
www Merge remote-tracking branch 'origin/master' 2015-01-20 12:45:38 +03:00
.fetch.json Update .fetch.json 2015-01-20 12:47:16 +03:00
LICENSE.md Update LICENSE.md 2015-02-04 10:26:17 +03:00
package.json Update package.json 2015-09-09 11:50:17 +03:00
plugin.xml Merge remote-tracking branch 'origin/master' 2015-01-20 12:45:38 +03:00
README.md update readme, add types 2015-12-07 16:35:07 +03:00

cordova-plugin-startapp # Upd 7.11.2015

Phonegap 3.x.x plugin for check or launch other application in android device.

=========================================== Install: cordova plugin add com.lampa.startapp

Install: cordova plugin add https://github.com/lampaa/com.lampa.startapp.git

Delete: cordova plugin rm com.lampa.startapp

Delete previos version: cordova plugin rm org.apache.cordova.startapp

===========================================

Manually installation for Android: on progress...

use: ANDROID

Check application for installed

navigator.startApp.check("com.application.name", function(message) { /* success */
	console.log(message); // => OK
}, 
function(error) { /* error */
	console.log(error);
});

Start application without parameters

navigator.startApp.start("com.application.name", function(message) {  /* success */
	console.log(message); // => OK
}, 
function(error) { /* error */
	console.log(error);
});

_Start application with params. First variant with package and activity:

navigator.startApp.start([["com.app.name", "com.app.name.Activity"]], function(message) { /* success */
	console.log(message); // => OK
}, 
function(error) { /* error */
	console.log(error);
});

_Start application with params. Second variant with action and action params:

navigator.startApp.start([["action", "ACTION_NAME", "PACKAGE", "TYPE", "URI"]], function(message) { /* success */
	console.log(message); // => OK
}, 
function(error) { /* error */
	console.log(error);
});

ACTION_NAME these is a Intent flag Intent Flags (MAIN, VIEW, CALL, etc..).

PACKAGE these is a Intent method (optional or set null) setPackage

TYPE these is a Intent method (optional or set null) setType

URI these is a Intent data Uri (optional or set null) [Uri](http://developer.android.com/intl/ru/reference/android/content/Intent.html#Intent(java.lang.String, android.net.Uri))

Important! First value of first parameter of start method can be either a string or an array. And the array must contain two parameters. Example:

["com.app.name", [....]] or "com.app.name", "com.app.name.Activity"] [....

Start application with only values

navigator.startApp.start([[...], ["set_param1", "set_param2",..., "set_paramN"]], function(message) { /* success */
	console.log(message); // => OK
}, 
function(error) { /* error */
	console.log(error);
});

ANDROID: Start application with key:value parameters

navigator.startApp.start([[...], [{"key1":"value1"},{"key2":"value2"}, {...}, {"keyN":"valueN"}]], function(message) { /* success */
	console.log(message); // => OK
}, 
function(error) { /* error */
	console.log(error);
});

Example, call application with activity and key:value param:

navigator.startApp.start([["app.com.name", "app.com.name.Activity"], [{"product_id":"100"}]], ...);

Example, call skype:

navigator.startApp.start([["action", "VIEW"], ["skype:+79109999999"]], ...);

Example, call phone:

navigator.startApp.start([["action", "CALL"], ["tel:+79109999999"]], ...);

Example, call browser:

navigator.startApp.start([["action", "VIEW"], ["https://github.com/lampaa"]], ...);

Example, call facebook:

navigator.startApp.start([["action", "VIEW"], ["fb://facewebmodal/f?href=https://www.facebook.com/GitHub"]], ...);

Example, call whatsapp:

navigator.startApp.start([["action", "SEND", "com.whatsapp", "text/plain"], [{"android.intent.extra.TEXT":"Text..."}]], ...);

Example, call whatsapp chat:

navigator.startApp.start([["action", "SEND", "com.whatsapp", "text/plain", "+79123456789"], [{"android.intent.extra.TEXT":"Text..."}, {"chat", true}]], ...);

Use iOS

Check iOS application for installed

navigator.startApp.check("twitter://", function(message) { /* success */
	console.log(message); // => OK
}, 
function(error) { /* error */
	console.log(error);
});

Start iOS application

navigator.startApp.start("twitter://", function(message) { /* success */
	console.log(message); // => OK
}, 
function(error) { /* error */
	console.log(error);
});

=========================================== Tags:

Cordova start external application. Android open an external application. Phonegap start external application. Launching External Intents Works on Cordova. Android launch external activities.