diff --git a/src/index.ts b/src/index.ts index 470cca1814..22e17cb3cb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,6 +18,7 @@ import { BarcodeScanner } from './plugins/barcodescanner'; import { Base64ToGallery } from './plugins/base64togallery'; import { BatteryStatus } from './plugins/batterystatus'; import { Brightness } from './plugins/brightness'; +import { BrowserTab } from './plugins/browser-tab'; import { BLE } from './plugins/ble'; import { BluetoothSerial } from './plugins/bluetoothserial'; import { Broadcaster } from './plugins/broadcaster'; @@ -142,6 +143,7 @@ export * from './plugins/batterystatus'; export * from './plugins/ble'; export * from './plugins/bluetoothserial'; export * from './plugins/brightness'; +export * from './plugins/browser-tab'; export * from './plugins/broadcaster'; export * from './plugins/calendar'; export * from './plugins/call-number'; @@ -264,6 +266,7 @@ window['IonicNative'] = { Base64ToGallery, BatteryStatus, Brightness, + BrowserTab, BLE, BluetoothSerial, Broadcaster, diff --git a/src/plugins/browser-tab.ts b/src/plugins/browser-tab.ts new file mode 100644 index 0000000000..7cd244e710 --- /dev/null +++ b/src/plugins/browser-tab.ts @@ -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} Returns a promise that resolves when check is successful and returns true or false + */ + @Cordova() + static isAvailable(): Promise { + 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} Returns a promise that resolves when check open was successful + */ + @Cordova() + static openUrl(url: string): Promise { + return; + } + + /** + * Closes browser tab + * @return {Promise} Returns a promise that resolves when close was finished + */ + @Cordova() + static close(): Promise { + return; // We add return; here to avoid any IDE / Compiler errors + } +} diff --git a/src/plugins/firebase.ts b/src/plugins/firebase.ts index cc1e662f37..647eeaecb6 100644 --- a/src/plugins/firebase.ts +++ b/src/plugins/firebase.ts @@ -62,6 +62,15 @@ export class Firebase { }) static grantPermission(): Promise { return; } + /** + * Check permission to recieve push notifications + * @return {Promise} + */ + @Cordova({ + platforms: ['iOS'] + }) + static hasPermission(): Promise { return; } + /** * Set icon badge number. Set to 0 to clear the badge. * @param badgeNumber {number}