Skip to content

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

License

Notifications You must be signed in to change notification settings

bernardogontijo/com.lampa.startapp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-startapp # Upd 18.12.2014

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 package name 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);
});

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"}]], ...);

ANDROID: Start application with action parameters

navigator.startApp.start([["action", "ACTION_NAME"], ["tel:+79109999999"]], 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..).

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"]], ...);

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 29.4%
  • Java 29.0%
  • CSS 24.3%
  • Objective-C 10.6%
  • HTML 6.7%