Merge branch 'master' into v5

This commit is contained in:
Daniel
2018-09-18 16:24:05 +02:00
parent 7cff234c26
commit 38a1dd1187
11 changed files with 376 additions and 161 deletions
@@ -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;
}
}
@@ -118,6 +118,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.
*
@@ -147,39 +171,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.
*
@@ -194,4 +185,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 {}
}
+1 -1
View File
@@ -268,7 +268,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)
* );
* ```
@@ -267,66 +267,3 @@ export class IntelSecurityStorage {
return;
}
}
/**
* @name Intel Security
* @description
* The App Security API enables the use of security properties and capabilities on the platform, using a new set of API defined for application developers. You are not required to be a security expert to make good use of the API. Key elements, such as encryption of data and establishments of capabilities, is abstracted and done by the API implementation, for you.
*
* For example:
* - Use the API to store (E.g. cache) data locally, using the device non-volatile storage. Data protection/encryption will be done for you by the API implementation
* - Establish a connection with remote server (E.g. XHR) using a protected channel. SSL/TLS establishment and usage will be done for you by the API implementation
*
* For more information please visit the [API documentation](https://software.intel.com/en-us/app-security-api/api).
*
* @usage
* ```typescript
* import { IntelSecurity } from '@ionic-native/intel-security';
* ...
* constructor(private intelSecurity: IntelSecurity) { }
* ...
*
* let storageID = 'id';
*
* this.intelSecurity.data.createFromData({ data: 'Sample Data' })
* .then((instanceID: Number) => this.intelSecurity.storage.write({ id: storageId, instanceID: instanceID }))
* .catch((error: any) => console.log(error));
*
* this.intelSecurity.storage.read({id: storageID })
* .then((instanceID: number) => this.intelSecurity.data.getData(instanceID))
* .then((data: string) => console.log(data)) // Resolves to 'Sample Data'
* .catch((error: any) => console.log(error));
*
* this.intelSecurity.storage.delete({ id: storageID })
* .then(() => console.log('Deleted Successfully'))
* .catch((error: any) => console.log(error));
* ```
* @classes
* IntelSecurityData
* IntelSecurityStorage
* @interfaces
* IntelSecurityDataOptions
*/
@Plugin({
pluginName: 'IntelSecurity',
plugin: 'com-intel-security-cordova-plugin',
pluginRef: 'intel.security',
repo: 'https://github.com/AppSecurityApi/com-intel-security-cordova-plugin',
platforms: ['Android', 'iOS', 'Windows', 'Windows Phone 8']
})
@Injectable()
export class IntelSecurity extends IonicNativePlugin {
/**
* returns an IntelSecurityStorage object
* @type {IntelSecurityStorage}
*/
storage: IntelSecurityStorage = new IntelSecurityStorage();
/**
* Returns an IntelSecurityData object
* @type {IntelSecurityData}
*/
data: IntelSecurityData = new IntelSecurityData();
}
@@ -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 | ILocalNotification[]} optional
@@ -570,20 +588,31 @@ export class LocalNotifications extends IonicNativePlugin {
}
/**
* Get all the notification ids
* @returns {Promise<number[]>}
* 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()
getIds(): Promise<number[]> {
hasType(id: number, type: string): Promise<boolean> {
return;
}
/**
* Get the ids of triggered notifications
* @returns {Promise<number[]>}
* Get the type (triggered, scheduled) for the notification.
* @param {number} id The ID of the notification.
*/
@Cordova()
getTriggeredIds(): Promise<number[]> {
getType(id: number): Promise<boolean> {
return;
}
/**
* Get all the notification ids
* @returns {Promise<Array<number>>}
*/
@Cordova()
getIds(): Promise<number[]> {
return;
}
@@ -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<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<ILocalNotification[]>}
*/
@Cordova()
getAll(): Promise<ILocalNotification[]> {
return;
}
/**
* Get all scheduled notification objects
* @returns {Promise<ILocalNotification[]>}
*/
@Cordova()
getAllScheduled(): Promise<ILocalNotification[]> {
return;
}
/**
* Get all triggered notification objects
* @returns {Promise<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
@@ -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']
})
@@ -418,6 +418,7 @@ export enum OSActionType {
export class OneSignal extends IonicNativePlugin {
/**
* constants to use in inFocusDisplaying()
* @hidden
*/
OSInFocusDisplayOption = {
None: 0,
@@ -671,6 +672,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:
@@ -702,9 +710,64 @@ export class OneSignal extends IonicNativePlugin {
return;
}
/**
* Clears all OneSignal notifications
*/
@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 {}
}
+3
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;
+1 -1
View File
@@ -129,7 +129,7 @@ export class SQLiteObject {
* @returns {Promise<any>}
*/
@CordovaInstance()
sqlBatch(sqlStatements: string[] | string[][] | any[]): Promise<any> {
sqlBatch(sqlStatements: (string | string[] | any)[]): Promise<any> {
return;
}
@@ -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}