Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added plugin to launch external apps
- Loading branch information
1 parent
82b512f
commit 0631c0a
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# External App Launcher | ||
|
||
A Cordova plugin to launch external applications from your Cordova-based iOS application. | ||
|
||
### Steps to install | ||
|
||
1. Install [cordova-plugman](https://github.com/apache/cordova-plugman). | ||
2. ```cd``` into your project directory. | ||
3. Execute the following command: | ||
|
||
``` | ||
plugman --platform ios --project . --plugin https://github.com/sbahal/external-app-launcher.git | ||
``` | ||
|
||
### Steps to uninstall | ||
|
||
``` | ||
plugman --uninstall --platform ios --project . --plugin org.cordova.plugins.ExternalAppLauncher | ||
``` | ||
|
||
### Usage | ||
|
||
``` | ||
externalApp.launch([appUrlScheme, storeUrl, alertMessage, alertType]); | ||
``` | ||
where, | ||
```appUrlScheme```: the URL scheme of the app that you wish to launch | ||
```storeUrl```: the URL to be redirected to in case the external app is not found | ||
```alertMessage```: the message to be displayed to the user in case the external app is not found | ||
```alertType```: the type of alert to be presented to the user | ||
* ```externalApp.alertType.OK```: to just display an alert message, or | ||
* ```externalApp.alertType.OK_CANCEL```: to redirect the user to the specified store | ||
|
||
### Example | ||
|
||
``` | ||
externalApp.launch('com.foo.MyApp', '', 'Please download the latest version of this app from the store', externalApp.alertType.OK); | ||
externalApp.launch('com.foo.MyApp', 'https://foo.com', 'Please download the latest version of this app from the store', externalApp.alertType.OK_CANCEL); | ||
``` |