Merge remote-tracking branch 'origin/master'

This commit is contained in:
Daniel 2018-09-18 22:29:20 +02:00
commit c0d8c99e8d
12 changed files with 299 additions and 127 deletions

View File

@ -1,3 +1,23 @@
<a name="4.14.0"></a>
# [4.14.0](https://github.com/ionic-team/ionic-native/compare/v4.13.0...v4.14.0) (2018-09-18)
### Bug Fixes
* **mobile-accessibility:** add correct pluginRef ([3699fa9](https://github.com/ionic-team/ionic-native/commit/3699fa9)), closes [#1860](https://github.com/ionic-team/ionic-native/issues/1860)
* **onesignal:** add missing setLocationShared method ([#2723](https://github.com/ionic-team/ionic-native/issues/2723)) ([8bab321](https://github.com/ionic-team/ionic-native/commit/8bab321))
* **push:** add missing Chanel options ([3ef9593](https://github.com/ionic-team/ionic-native/commit/3ef9593)), closes [#2712](https://github.com/ionic-team/ionic-native/issues/2712)
* **web-intent:** add missing properties ([d077c48](https://github.com/ionic-team/ionic-native/commit/d077c48)), closes [#2701](https://github.com/ionic-team/ionic-native/issues/2701)
### Features
* **chooster:** add plugin ([04db233](https://github.com/ionic-team/ionic-native/commit/04db233)), closes [#2612](https://github.com/ionic-team/ionic-native/issues/2612)
* **local-notifications:** add missing functions ([10d222d](https://github.com/ionic-team/ionic-native/commit/10d222d))
* **onesignal:** add missing functions ([51006a7](https://github.com/ionic-team/ionic-native/commit/51006a7)), closes [#2504](https://github.com/ionic-team/ionic-native/issues/2504)
<a name="4.13.0"></a>
# [4.13.0](https://github.com/ionic-team/ionic-native/compare/v4.12.3...v4.13.0) (2018-09-15)

48
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "4.13.0",
"version": "4.14.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -2923,9 +2923,9 @@
"dev": true
},
"dependency-graph": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.4.1.tgz",
"integrity": "sha1-MC5YIY2FxRqXY4cw2/m32FKhlpM=",
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.7.2.tgz",
"integrity": "sha512-KqtH4/EZdtdfWX0p6MGP9jljvxSY6msy/pRUD4jgNwVpv3v1QmNLlsB3LDSSUg79BRVSn7jI1QPRtArGABovAQ==",
"dev": true
},
"deprecated": {
@ -2963,34 +2963,20 @@
}
},
"dgeni": {
"version": "0.4.7",
"resolved": "https://registry.npmjs.org/dgeni/-/dgeni-0.4.7.tgz",
"integrity": "sha1-UHBifdKPiNSABuIfVa+xipy4vmg=",
"version": "0.4.10",
"resolved": "https://registry.npmjs.org/dgeni/-/dgeni-0.4.10.tgz",
"integrity": "sha512-In8huU+6W+Rd7MdfzhQoRbntF4AsJgtbwRUTyfPgvhaC3RGJX/YOEkMnn7vLLk3zaCrEkIQGW6eADoudpnBceg==",
"dev": true,
"requires": {
"canonical-path": "~0.0.2",
"dependency-graph": "~0.4.1",
"dependency-graph": "^0.7.0",
"di": "0.0.1",
"lodash": "^3.10.1",
"lodash": "^4.17.10",
"objectdiff": "^1.1.0",
"optimist": "~0.6.1",
"q": "~1.4.1",
"validate.js": "^0.9.0",
"q": "^1.5.1",
"validate.js": "^0.12.0",
"winston": "^2.1.1"
},
"dependencies": {
"lodash": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
"integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
"dev": true
},
"q": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz",
"integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=",
"dev": true
}
}
},
"dgeni-packages": {
@ -11589,9 +11575,9 @@
}
},
"validate.js": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/validate.js/-/validate.js-0.9.0.tgz",
"integrity": "sha1-is8BRPFSChmDXGzGY/ReCDaqVsg=",
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/validate.js/-/validate.js-0.12.0.tgz",
"integrity": "sha512-/x2RJSvbqEyxKj0RPN4xaRquK+EggjeVXiDDEyrJzsJogjtiZ9ov7lj/svVb4DM5Q5braQF4cooAryQbUwOxlA==",
"dev": true
},
"verror": {
@ -11757,9 +11743,9 @@
"optional": true
},
"winston": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/winston/-/winston-2.4.0.tgz",
"integrity": "sha1-gIBQuT1SZh7Z+2wms/DIJnCLCu4=",
"version": "2.4.4",
"resolved": "https://registry.npmjs.org/winston/-/winston-2.4.4.tgz",
"integrity": "sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q==",
"dev": true,
"requires": {
"async": "~1.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "4.13.0",
"version": "4.14.0",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"homepage": "https://ionicframework.com/",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@ -16,7 +16,7 @@
"child-process-promise": "2.2.1",
"conventional-changelog-cli": "^2.0.5",
"cz-conventional-changelog": "^2.1.0",
"dgeni": "0.4.7",
"dgeni": "^0.4.10",
"dgeni-packages": "0.16.10",
"fs-extra": "^7.0.0",
"gulp": "3.9.1",

View File

@ -10,7 +10,7 @@ const ROOT = path.resolve(path.join(__dirname, '../../')),
const FLAGS = '--access public'; // add any flags here if you want... (example: --tag alpha)
const PACKAGES = fs.readdir(DIST);
const PACKAGES = fs.readdirSync(DIST);
const failedPackages = [];

View File

@ -0,0 +1,67 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface ChooserResult {
data: Uint8Array;
dataURI: string;
mediaType: string;
name: string;
uri: string;
}
/**
* @name Chooser
* @description
* File chooser plugin for Cordova.
*
* The following must be added to config.xml to prevent crashing when selecting large files on Android:
* ```xml
* <platform name="android">
* <edit-config
* file="app/src/main/AndroidManifest.xml"
* mode="merge"
* target="/manifest/application">
* <application android:largeHeap="true" />
* </edit-config>
* </platform>
* ```
*
* @usage
* ```typescript
* import { Chooser } from '@ionic-native/chooser';
*
*
* constructor(private chooser: Chooser) { }
*
* ...
*
*
* this.chooser.getFile()
* .then(file => console.log(file ? file.name : 'canceled'))
* .catch((error: any) => console.error(error));
*
* ```
*
* @interfaces
* ChooserResult
*/
@Plugin({
pluginName: 'Chooser',
plugin: 'cordova-plugin-chooser',
pluginRef: 'chooser',
repo: 'https://github.com/cyph/cordova-plugin-chooser',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Chooser extends IonicNativePlugin {
/**
* Displays native prompt for user to select a file.
* @param {string} [accept] Optional MIME type filter (e.g. 'image/gif,video/*').
* @return {Promise<any>} Promise containing selected file's raw binary data,
* base64-encoded data: URI, MIME type, display name, and original URI.
*/
@Cordova()
getFile(accept: string): Promise<ChooserResult | undefined> {
return;
}
}

View File

@ -117,6 +117,30 @@ export interface EmailComposerOptions {
})
@Injectable()
export class EmailComposer extends IonicNativePlugin {
/**
* Checks if the app has a permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
*/
@Cordova({
successIndex: 0,
errorIndex: 2
})
hasPermission(): Promise<boolean> {
return;
}
/**
* Request permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
*/
@Cordova({
successIndex: 0,
errorIndex: 2
})
requestPermission(): Promise<boolean> {
return;
}
/**
* Verifies if sending emails is supported on the device.
*
@ -146,39 +170,6 @@ export class EmailComposer extends IonicNativePlugin {
});
}
/**
* Request permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
*/
@Cordova({
successIndex: 0,
errorIndex: 2
})
requestPermission(): Promise<boolean> {
return;
}
/**
* Checks if the app has a permission to access email accounts information
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if the permission was granted
*/
@Cordova({
successIndex: 0,
errorIndex: 2
})
hasPermission(): Promise<boolean> {
return;
}
/**
* Adds a new mail app alias.
*
* @param {string} alias The alias name
* @param {string} packageName The package name
*/
@Cordova()
addAlias(alias: string, packageName: string): void {}
/**
* Displays the email composer pre-filled with data.
*
@ -193,4 +184,13 @@ export class EmailComposer extends IonicNativePlugin {
open(options: EmailComposerOptions, scope?: any): Promise<any> {
return;
}
/**
* Adds a new mail app alias.
*
* @param {string} alias The alias name
* @param {string} packageName The package name
*/
@Cordova()
addAlias(alias: string, packageName: string): void {}
}

View File

@ -266,7 +266,7 @@ export interface IBeaconDelegate {
*
* this.ibeacon.startMonitoringForRegion(beaconRegion)
* .then(
* () => console.log('Native layer recieved the request to monitoring'),
* () => console.log('Native layer received the request to monitoring'),
* error => console.error('Native layer failed to begin monitoring: ', error)
* );
* ```

View File

@ -483,6 +483,24 @@ export interface ILocalNotification {
})
@Injectable()
export class LocalNotifications extends IonicNativePlugin {
/**
* Informs if the app has the permission to show notifications.
* @returns {Promise<boolean>}
*/
@Cordova()
hasPermission(): Promise<boolean> {
return;
}
/**
* Request permission to show notifications if not already granted.
* @returns {Promise<boolean>}
*/
@Cordova()
requestPermission(): Promise<boolean> {
return;
}
/**
* Schedules a single or multiple notifications
* @param options {Notification | Array<ILocalNotification>} optional
@ -569,6 +587,26 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Check if a notification has a given type.
* @param {number} id The ID of the notification.
* @param {string} type The type of the notification.
* @returns {Promise<boolean>}
*/
@Cordova()
hasType(id: number, type: string): Promise<boolean> {
return;
}
/**
* Get the type (triggered, scheduled) for the notification.
* @param {number} id The ID of the notification.
*/
@Cordova()
getType(id: number): Promise<boolean> {
return;
}
/**
* Get all the notification ids
* @returns {Promise<Array<number>>}
@ -578,15 +616,6 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get the ids of triggered notifications
* @returns {Promise<Array<number>>}
*/
@Cordova()
getTriggeredIds(): Promise<number[]> {
return;
}
/**
* Get the ids of scheduled notifications
* @returns {Promise<Array<number>>} Returns a promise
@ -596,6 +625,15 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get the ids of triggered notifications
* @returns {Promise<Array<number>>}
*/
@Cordova()
getTriggeredIds(): Promise<number[]> {
return;
}
/**
* Get a notification object
* @param notificationId {any} The id of the notification to get
@ -606,6 +644,15 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get all notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAll(): Promise<ILocalNotification[]> {
return;
}
/**
* Get a scheduled notification object
* @param notificationId {any} The id of the notification to get
@ -626,51 +673,6 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get all notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAll(): Promise<ILocalNotification[]> {
return;
}
/**
* Get all scheduled notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllScheduled(): Promise<ILocalNotification[]> {
return;
}
/**
* Get all triggered notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllTriggered(): Promise<ILocalNotification[]> {
return;
}
/**
* Request permission to show notifications if not already granted.
* @returns {Promise<boolean>}
*/
@Cordova()
requestPermission(): Promise<boolean> {
return;
}
/**
* Informs if the app has the permission to show notifications.
* @returns {Promise<boolean>}
*/
@Cordova()
hasPermission(): Promise<boolean> {
return;
}
/**
* Adds a group of actions
* @param groupId The id of the action group
@ -678,10 +680,7 @@ export class LocalNotifications extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
addActions(
groupId: any,
actions: ILocalNotificationAction[]
): Promise<any> {
addActions(groupId: any, actions: ILocalNotificationAction[]): Promise<any> {
return;
}
@ -727,6 +726,24 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get all scheduled notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllScheduled(): Promise<ILocalNotification[]> {
return;
}
/**
* Get all triggered notification objects
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllTriggered(): Promise<ILocalNotification[]> {
return;
}
/**
* Sets a callback for a specific event
* @param eventName {string} The name of the event. Available events: schedule, trigger, click, update, clear, clearall, cancel, cancelall. Custom event names are possible for actions

View File

@ -23,7 +23,7 @@ import { Injectable } from '@angular/core';
@Plugin({
pluginName: 'MobileAccessibility',
plugin: 'phonegap-plugin-mobile-accessibility',
pluginRef: 'MobileAccessibility',
pluginRef: 'window.MobileAccessibility',
repo: 'https://github.com/phonegap/phonegap-mobile-accessibility',
platforms: ['Android Fire OS', 'Android', 'iOS', 'Windows']
})

View File

@ -415,6 +415,7 @@ export enum OSActionType {
export class OneSignal extends IonicNativePlugin {
/**
* constants to use in inFocusDisplaying()
* @hidden
*/
OSInFocusDisplayOption = {
None: 0,
@ -668,6 +669,13 @@ export class OneSignal extends IonicNativePlugin {
@Cordova({ sync: true })
setLogLevel(logLevel: { logLevel: number; visualLevel: number }): void {}
/**
* Disable or enable location collection (Defaults to enabled) if your app has location permission.
* @param shared {boolean}
*/
@Cordova({ sync: true })
setLocationShared(shared: boolean): void {}
/**
* The passed in function will be fired when a notification permission setting changes.
* This includes the following events:
@ -699,9 +707,66 @@ export class OneSignal extends IonicNativePlugin {
return;
}
/**
* Allows you to set the user's email address with the OneSignal SDK.
* @param {string} email Email address
* @param {string} [emailAuthToken] Email auth token
*/
@Cordova()
setEmail(email: string, emailAuthToken?: string): Promise<any> {
return;
}
/**
* If your app implements logout functionality, you can call logoutEmail to dissociate the email from the device
*/
@Cordova()
logoutEmail(): Promise<any> {
return;
}
/**
* The passed in function will be fired when a notification subscription property changes.
* This includes the following events:
* - Getting a push token from Apple / Google.
* - Getting a player / user id from OneSignal
* - OneSignal.setSubscription is called
* - User disables or enables notifications
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
addEmailSubscriptionObserver(): Observable<any> {
return;
}
/**
* Clears all OneSignal notifications
*/
@Cordova({ sync: true })
clearOneSignalNotifications(): void {}
/**
* Allows you to delay the initialization of the SDK until the user provides privacy consent.
* The SDK will not be fully initialized until the provideUserConsent(true) method is called.
* @param {boolean} required
*/
@Cordova()
setRequiresUserPrivacyConsent(required: boolean): void {}
/**
* If your application is set to require the user's privacy consent, you can provide this consent using this method.
* Until you call provideUserConsent(true), the SDK will not fully initialize and will not send any data to OneSignal.
* @param {boolean} granted
*/
@Cordova()
provideUserConsent(granted: boolean): void {}
/**
* Accepts a callback, which returns a boolean variable indicating if the user has given privacy consent yet.
* @param {Function} callback
*/
@Cordova()
userProvidedPrivacyConsent(callback: Function): void {}
}

View File

@ -221,12 +221,15 @@ export interface PushOptions {
}
export type Priority = 1 | 2 | 3 | 4 | 5;
export type Visibility = 0 | 1 | -1;
export interface Channel {
id: string;
description: string;
importance: Priority;
sound?: string;
vibration?: boolean | number[];
visibility?: Visibility;
}
export type PushEvent = string;

View File

@ -127,6 +127,20 @@ export class WebIntent extends IonicNativePlugin {
@CordovaProperty
ACTION_PICK: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty
ACTION_INSTALL_PACKAGE: string;
/**
* Convenience constant for actions
* @type {string}
*/
@CordovaProperty
ACTION_UNINSTALL_PACKAGE: string;
/**
* Launches an Android intent
* @param options {IntentOptions}