Skip to content

Open a specific URL in the external browser of the hosting OS.

License

Notifications You must be signed in to change notification settings

tutormundi/OpenUrlExt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenUrlExt

Open a specific URL in the external browser of the hosting OS.

Installation

cordova plugin add cordova-plugin-openurlext
OR
cordova plugin add https://github.com/PaoloMessina/OpenUrlExt

License

This plugin is released under the MIT license

API

open

OpenUrlExt.open(url, onSuccess, onFailure);

Arguments:

  • url: The url too open, will be encoded.
  • onSuccess: function () {...} Callback for successful scan.
  • onFailure: function () {...} Callback for cancelled scan or error.

Return:

  • success() Successful opening
  • error() Error on opening

Example:

```javascript
{
    OpenUrlExt.open(urlString,
    				function(){ 
    					console.log("ok");
    				}, 
    				function(){ 
    					console.log("ko");
    				});
}
```

Quirks:

  • Android: The plugin is not native but a simple call to javascript that just working well.
  • iOS: The plugin calls success() when URL or app is opened, and error() in the following cases:
    • URL is blank
    • Custom URL is not available
    • User cancels opening of custom URL

About

Open a specific URL in the external browser of the hosting OS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 56.7%
  • JavaScript 43.3%