From 9c75e537028684f8e89172f00e64ad15be1c7ba8 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 31 Aug 2018 19:29:20 +0200 Subject: [PATCH] Merge branch 'master' into v5 --- CHANGELOG.md | 70 +++++++++++++++++++ src/@ionic-native/plugins/aes-256/index.ts | 46 ++++++++++-- .../plugins/in-app-browser/index.ts | 37 ++++++---- .../plugins/open-native-settings/index.ts | 6 +- src/@ionic-native/plugins/push/index.ts | 15 ++-- 5 files changed, 148 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f8cc5b41..7bf0fb030 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,76 @@ + +# [5.0.0-beta.14](https://github.com/ionic-team/ionic-native/compare/v4.10.0...v5.0.0-beta.14) (2018-07-18) + + +### Features + +* **aes256:** Added new utility methods to generate secure key and secure IV ([#2675](https://github.com/ionic-team/ionic-native/issues/2675)) ([a731466](https://github.com/ionic-team/ionic-native/commit/a731466)) +* **in-app-browser:** Add missing InAppBrowserOptions-properties ([#2669](https://github.com/ionic-team/ionic-native/issues/2669)) ([d90724e](https://github.com/ionic-team/ionic-native/commit/d90724e)) +* **push:** Added voip property to IOSPushOptions ([#2681](https://github.com/ionic-team/ionic-native/issues/2681)) ([03e4f0e](https://github.com/ionic-team/ionic-native/commit/03e4f0e)) + + + + +# [5.0.0-beta.15](https://github.com/ionic-team/ionic-native/compare/v4.12.0...v5.0.0-beta.15) (2018-08-25) + + +### Features + +* **bluetooth-le:** add bluetooth-le plugin ([#2651](https://github.com/ionic-team/ionic-native/issues/2651)) ([591ee87](https://github.com/ionic-team/ionic-native/commit/591ee87)) +* **http:** add setSSLCertMode function ([8db1dbe](https://github.com/ionic-team/ionic-native/commit/8db1dbe)) + + + + +# [4.12.0](https://github.com/ionic-team/ionic-native/compare/v4.11.0...v4.12.0) (2018-08-16) + + +### Bug Fixes + +* **extended-device-information:** Fixed Memory Display Bug ([#2641](https://github.com/ionic-team/ionic-native/issues/2641)) ([2ac5282](https://github.com/ionic-team/ionic-native/commit/2ac5282)) +* **network:** bind listener to document instead of window ([#2622](https://github.com/ionic-team/ionic-native/issues/2622)) ([d10777a](https://github.com/ionic-team/ionic-native/commit/d10777a)) +* **photo-library:** interface missing includeVideos ([3f415f9](https://github.com/ionic-team/ionic-native/commit/3f415f9)), closes [#2624](https://github.com/ionic-team/ionic-native/issues/2624) + + +### Features + +* **fabric:** add fabric plugin ([#2618](https://github.com/ionic-team/ionic-native/issues/2618)) ([9b4fd02](https://github.com/ionic-team/ionic-native/commit/9b4fd02)) +* **local-notifications:** add new foreground property ([#2633](https://github.com/ionic-team/ionic-native/issues/2633)) ([229b62c](https://github.com/ionic-team/ionic-native/commit/229b62c)) +* **webengage:** add optional config with initialization ([#2637](https://github.com/ionic-team/ionic-native/issues/2637)) ([ca9a702](https://github.com/ionic-team/ionic-native/commit/ca9a702)) + + + + +# [4.11.0](https://github.com/ionic-team/ionic-native/compare/v4.10.1...v4.11.0) (2018-07-29) + + +### Bug Fixes + +* **http:** add correct return types for downloadFile and uploadFile ([4092831](https://github.com/ionic-team/ionic-native/commit/4092831)), closes [#2615](https://github.com/ionic-team/ionic-native/issues/2615) + + +### Features + +* **clevertap:** add CleverTap plugin ([#2609](https://github.com/ionic-team/ionic-native/issues/2609)) ([27d380e](https://github.com/ionic-team/ionic-native/commit/27d380e)) +* **facebook:** add getDeferredApplink function ([3b32e19](https://github.com/ionic-team/ionic-native/commit/3b32e19)), closes [#2510](https://github.com/ionic-team/ionic-native/issues/2510) +* **webengage:** add webengage plugin ([#2604](https://github.com/ionic-team/ionic-native/issues/2604)) ([bd5bd7e](https://github.com/ionic-team/ionic-native/commit/bd5bd7e)) + + + + +## [4.10.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.14...v4.10.1) (2018-07-25) + + +### Bug Fixes + +* **nfs:** Optional arguments for records like textRecord ([#2605](https://github.com/ionic-team/ionic-native/issues/2605)) ([b635ba9](https://github.com/ionic-team/ionic-native/commit/b635ba9)) +* **user-agent:** Plugin not installed ([#2607](https://github.com/ionic-team/ionic-native/issues/2607)) ([79cb478](https://github.com/ionic-team/ionic-native/commit/79cb478)) + + + # [5.0.0-beta.14](https://github.com/ionic-team/ionic-native/compare/v4.10.0...v5.0.0-beta.14) (2018-07-18) diff --git a/src/@ionic-native/plugins/aes-256/index.ts b/src/@ionic-native/plugins/aes-256/index.ts index 5208e9fcc..3043595ca 100644 --- a/src/@ionic-native/plugins/aes-256/index.ts +++ b/src/@ionic-native/plugins/aes-256/index.ts @@ -12,20 +12,38 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * ```typescript * import { AES256 } from '@ionic-native/aes-256'; * + * private secureKey: string; + * private secureIV: string; * - * constructor(private aES256: AES256) { } + * constructor(private aes256: AES256) { + * this.generateSecureKeyAndIV(); // To generate the random secureKey and secureIV + * } * * ... * + * async generateSecureKeyAndIV() { + * this.secureKey = await this.aes256.generateSecureKey('random password 12345'); // Returns a 32 bytes string + * this.secureIV = await this.aes256.generateSecureIV('random password 12345'); // Returns a 16 bytes string + * } * - * this.aES256.encrypt('12345678123456781234567812345678', '1234567812345678', 'testdata') + * this.aes256.encrypt(this.secureKey, this.secureIV, 'testdata') * .then(res => console.log('Encrypted Data: ',res)) * .catch((error: any) => console.error(error)); * - * this.aES256.decrypt('12345678123456781234567812345678', '1234567812345678', 'encryptedData') + * this.aes256.decrypt(this.secureKey, this.secureIV, 'encryptedData') * .then(res => console.log('Decrypted Data : ',res)) * .catch((error: any) => console.error(error)); * + * + * * this.aes256.generateSecureKey('random password 12345') + * .then(res => console.log('Secure Key : ',res)) + * .catch((error: any) => console.error(error)); + * + * + * * this.aes256.generateSecureIV('random password 12345') + * .then(res => console.log('Secure IV : ',res)) + * .catch((error: any) => console.error(error)); + * * ``` */ @Plugin({ @@ -38,7 +56,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; }) @Injectable() export class AES256 extends IonicNativePlugin { - /** * This function used to perform the aes256 encryption * @param {string} secureKey A 32 bytes string, which will used as input key for AES256 encryption. @@ -63,4 +80,25 @@ export class AES256 extends IonicNativePlugin { return; } + /** + * This function used to generate a secure key based on an password. Perfect if you want to delegate the key generation for encryption to the plugin. + * Make sure to save the return value of this function somewhere so your encrypted data can be decrypted in the future. + * @param {string} password A random string, which will be used as input for a PBKDF2 function + * @return {Promise} Returns a promise that resolves when key is generated. + */ + @Cordova() + generateSecureKey(password: string): Promise { + return; + } + + /** + * This function used to generate a secure IV based on an password. Perfect if you want to delegate the IV generation for encryption to the plugin. + * Make sure to save the return value of this function somewhere so your encrypted data can be decrypted in the future. + * @param {string} password A random string, which will be used as input for a PBKDF2 function + * @return {Promise} Returns a promise that resolves when IV is generated. + */ + @Cordova() + generateSecureIV(password: string): Promise { + return; + } } diff --git a/src/@ionic-native/plugins/in-app-browser/index.ts b/src/@ionic-native/plugins/in-app-browser/index.ts index 6887fd8f9..b3f6d4d35 100644 --- a/src/@ionic-native/plugins/in-app-browser/index.ts +++ b/src/@ionic-native/plugins/in-app-browser/index.ts @@ -1,11 +1,6 @@ -import { Observable, Observer } from 'rxjs'; import { Injectable } from '@angular/core'; -import { - CordovaInstance, - InstanceCheck, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; +import { CordovaInstance, InstanceCheck, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { Observable, Observer } from 'rxjs'; declare const cordova: Cordova & { InAppBrowser: any }; @@ -21,7 +16,13 @@ export interface InAppBrowserOptions { clearcache?: 'yes'; /** Set to yes to have the session cookie cache cleared before the new window is opened. */ clearsessioncache?: 'yes'; - /** (Android Only) set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */ + /* (Android) Set to a string to use as the close button's caption instead of a X. Note that you need to localize this value yourself. + * (iOS) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */ + closebuttoncaption?: string; + /* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the close button color from default, regardless of being a text or default X. Only has effect if user has location set to yes. + * (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default Done button's color. Only applicable if toolbar is not disabled. */ + closebuttoncolor?: string; + /** (Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */ zoom?: 'yes' | 'no'; /** * Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history. @@ -30,18 +31,29 @@ export interface InAppBrowserOptions { hardwareback?: 'yes' | 'no'; /** Set to yes to prevent HTML5 audio or video from autoplaying (defaults to no). */ mediaPlaybackRequiresUserAction?: 'yes' | 'no'; + /* (Android) Set to yes to hide the navigation buttons on the location toolbar, only has effect if user has location set to yes. The default value is no. + * (iOS) Set to yes or no to turn the toolbar navigation buttons on or off (defaults to no). Only applicable if toolbar is not disabled.*/ + hidenavigationbuttons?: 'yes' | 'no'; + /* (Android) Set to yes to hide the url bar on the location toolbar, only has effect if user has location set to yes. The default value is no.*/ + hideurlbar?: 'yes' | 'no'; + /* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color of both navigation buttons from default. Only has effect if user has location set to yes and not hidenavigationbuttons set to yes. + * (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color. Only applicable if navigation buttons are visible. */ + navigationbuttoncolor?: string; + /* (Android) Set to a valid hex color string, for example: #00ff00, and it will change the color the toolbar from default. Only has effect if user has location set to yes. + * (iOS) Set as a valid hex color string, for example: #00ff00, to change from the default color of the toolbar. Only applicable if toolbar is not disabled.*/ + toolbarcolor?: string; /** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */ shouldPauseOnSuspend?: 'yes' | 'no'; /** (Android Only) Set to yes to show a close button in the footer similar to the iOS Done button. The close button will appear the same as for the header hence use closebuttoncaption and closebuttoncolor to set its properties */ footer?: 'yes' | 'no'; - /** (Android Only) Set to a valid hex color string, for example #00ff00 or #CC00ff00 (#aarrggbb) , and it will change the footer color from default. Only has effect if user has footer set to yes */ + /** (Android Only) Set to a valid hex color string, for example #00ff00 or #CC00ff00 (#aarrggbb), and it will change the footer color from default. Only has effect if user has footer set to yes */ footercolor?: string; - /** (iOS Only) Set to a string to use as the Done button's caption. Note that you need to localize this value yourself. */ - closebuttoncaption?: string; /** (iOS Only) Set to yes or no (default is no). Turns on/off the UIWebViewBounce property. */ disallowoverscroll?: 'yes' | 'no'; /** (iOS Only) Set to yes or no to turn the toolbar on or off for the InAppBrowser (defaults to yes) */ toolbar?: 'yes' | 'no'; + /** (iOS Only) Set to yes or no to make the toolbar translucent(semi-transparent) (defaults to yes). Only applicable if toolbar is not disabled. */ + toolbartranslucent?: 'yes' | 'no'; /** (iOS Only) Set to yes or no to prevent viewport scaling through a meta tag (defaults to no). */ enableViewportScale?: 'yes' | 'no'; /* @@ -67,7 +79,8 @@ export interface InAppBrowserOptions { * Please note that if location=no is also specified, there will be no control presented to user to close IAB window. */ fullscreen?: 'yes'; - + /** (Android Only) Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is no, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is yes and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. (defaults to yes). */ + useWideViewPort?: 'yes' | 'no'; /** * @hidden */ diff --git a/src/@ionic-native/plugins/open-native-settings/index.ts b/src/@ionic-native/plugins/open-native-settings/index.ts index 055bc059c..065e731f1 100644 --- a/src/@ionic-native/plugins/open-native-settings/index.ts +++ b/src/@ionic-native/plugins/open-native-settings/index.ts @@ -1,5 +1,5 @@ -import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; /** * @name Open Native Settings @@ -101,11 +101,11 @@ import { Injectable } from '@angular/core'; export class OpenNativeSettings extends IonicNativePlugin { /** * Opens a setting dialog - * @param setting {string} setting name + * @param setting {string|array} setting name * @return {Promise} */ @Cordova() - open(setting: string): Promise { + open(setting: string | [string, boolean]): Promise { return; } } diff --git a/src/@ionic-native/plugins/push/index.ts b/src/@ionic-native/plugins/push/index.ts index aa5877faf..2bbe5e092 100644 --- a/src/@ionic-native/plugins/push/index.ts +++ b/src/@ionic-native/plugins/push/index.ts @@ -1,11 +1,5 @@ import { Injectable } from '@angular/core'; -import { - checkAvailability, - Cordova, - CordovaInstance, - IonicNativePlugin, - Plugin -} from '@ionic-native/core'; +import { checkAvailability, Cordova, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; declare const window: any; @@ -118,6 +112,13 @@ export interface IOSPushOptions { * Action Buttons on iOS - https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#action-buttons-1 */ categories?: CategoryArray; + + /** + * If true the device will be set up to receive VoIP Push notifications and the + * other options will be ignored since VoIP notifications are silent + * notifications that should be handled in the "notification" event. + */ + voip?: boolean | string; } export interface CategoryArray {