-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(browser-tab): add browser tab plugin (#1126)
* feature: added hasPermission function to Firebase fixes #1115 * feat: Implemented support for BrowserTab #1077
- Loading branch information
Showing
3 changed files
with
78 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
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,66 @@ | ||
/** | ||
* This is a template for new plugin wrappers | ||
* | ||
* TODO: | ||
* - Add/Change information below | ||
* - Document usage (importing, executing main functionality) | ||
* - Remove any imports that you are not using | ||
* - Add this file to /src/index.ts (follow style of other plugins) | ||
* - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs. | ||
* - Remove this note | ||
* | ||
*/ | ||
import { Plugin, Cordova } from './plugin'; | ||
|
||
/** | ||
* @name BrowserTab | ||
* @description | ||
* This plugin does something | ||
* | ||
* @usage | ||
* ``` | ||
* import { BrowserTab } from 'ionic-native'; | ||
* | ||
* BrowserTab.functionName('Hello', 123) | ||
* .then((something: any) => doSomething(something)) | ||
* .catch((error: any) => console.log(error)); | ||
* | ||
* ``` | ||
*/ | ||
@Plugin({ | ||
pluginName: 'BrowserTab', | ||
plugin: 'cordova-plugin-browsertab', // npm package name, example: cordova-plugin-camera | ||
pluginRef: 'cordova.plugins.browsertab', // the variable reference to call the plugin, example: navigator.geolocation | ||
repo: 'https://github.com/google/cordova-plugin-browsertab', // the github repository URL for the plugin | ||
platforms: ['Android', 'iOS'] | ||
}) | ||
export class BrowserTab { | ||
|
||
/** | ||
* Check if BrowserTab option is available | ||
* @return {Promise<any>} Returns a promise that resolves when check is successful and returns true or false | ||
*/ | ||
@Cordova() | ||
static isAvailable(): Promise<any> { | ||
return; // We add return; here to avoid any IDE / Compiler errors | ||
} | ||
|
||
/** | ||
* Opens the provided URL using a browser tab | ||
* @param {string} url The URL you want to open | ||
* @return {Promise<any>} Returns a promise that resolves when check open was successful | ||
*/ | ||
@Cordova() | ||
static openUrl(url: string): Promise<any> { | ||
return; | ||
} | ||
|
||
/** | ||
* Closes browser tab | ||
* @return {Promise<any>} Returns a promise that resolves when close was finished | ||
*/ | ||
@Cordova() | ||
static close(): Promise<any> { | ||
return; // We add return; here to avoid any IDE / Compiler errors | ||
} | ||
} |
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