docs(): update docs
This commit is contained in:
parent
a4216fd8ca
commit
d5ac89996f
@ -1,6 +1,5 @@
|
|||||||
import { Cordova, Plugin } from './plugin';
|
import { Cordova, Plugin } from './plugin';
|
||||||
|
|
||||||
|
|
||||||
export interface LaunchNavigatorOptions {
|
export interface LaunchNavigatorOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,6 +79,8 @@ export interface LaunchNavigatorOptions {
|
|||||||
* error => console.log('Error launching navigator', error)
|
* error => console.log('Error launching navigator', error)
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
|
* @interfaces
|
||||||
|
* LaunchNavigatorOptions
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'LaunchNavigator',
|
pluginName: 'LaunchNavigator',
|
||||||
|
@ -1,5 +1,87 @@
|
|||||||
import { Cordova, Plugin } from './plugin';
|
import { Cordova, Plugin } from './plugin';
|
||||||
|
|
||||||
|
export interface ILocalNotification {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
|
||||||
|
* Default: 0
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* First row of the notification
|
||||||
|
* Default: Empty string (iOS) or the app name (Android)
|
||||||
|
*/
|
||||||
|
title?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Second row of the notification
|
||||||
|
* Default: Empty string
|
||||||
|
*/
|
||||||
|
text?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year
|
||||||
|
* Default: 0 (which means that the system triggers the local notification once)
|
||||||
|
*/
|
||||||
|
every?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
|
||||||
|
* Default: now ~ new Date()
|
||||||
|
*/
|
||||||
|
at?: any;
|
||||||
|
firstAt?: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android)
|
||||||
|
* Default: 0 (which means don't show a number)
|
||||||
|
*/
|
||||||
|
badge?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uri of the file containing the sound to play when an alert is displayed
|
||||||
|
* Default: res://platform_default
|
||||||
|
*/
|
||||||
|
sound?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Arbitrary data, objects will be encoded to JSON string
|
||||||
|
* Default: null
|
||||||
|
*/
|
||||||
|
data?: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ANDROID ONLY
|
||||||
|
* Uri of the icon that is shown in the ticker and notification
|
||||||
|
* Default: res://icon
|
||||||
|
*/
|
||||||
|
icon?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ANDROID ONLY
|
||||||
|
* Uri of the resource (only res://) to use in the notification layouts. Different classes of devices may return different sizes
|
||||||
|
* Default: res://ic_popup_reminder
|
||||||
|
*/
|
||||||
|
smallIcon?: string;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ANDROID ONLY
|
||||||
|
* Ongoing notifications differ from regular notifications in the following ways:
|
||||||
|
* - They are sorted above the regular notifications in the notification panel
|
||||||
|
* - They do not have an 'X' close button, and are not affected by the "Clear all" button
|
||||||
|
* Default: false
|
||||||
|
*/
|
||||||
|
ongoing?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ANDROID ONLY
|
||||||
|
* ARGB value that you would like the LED on the device to blink
|
||||||
|
* Default: FFFFFF
|
||||||
|
*/
|
||||||
|
led?: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Local Notifications
|
* @name Local Notifications
|
||||||
@ -14,7 +96,7 @@ import { Cordova, Plugin } from './plugin';
|
|||||||
* // Schedule a single notification
|
* // Schedule a single notification
|
||||||
* LocalNotifications.schedule({
|
* LocalNotifications.schedule({
|
||||||
* id: 1,
|
* id: 1,
|
||||||
* text: 'Single Notification',
|
* text: 'Single ILocalNotification',
|
||||||
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf',
|
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf',
|
||||||
* data: { secret: key }
|
* data: { secret: key }
|
||||||
* });
|
* });
|
||||||
@ -23,26 +105,27 @@ import { Cordova, Plugin } from './plugin';
|
|||||||
* // Schedule multiple notifications
|
* // Schedule multiple notifications
|
||||||
* LocalNotifications.schedule([{
|
* LocalNotifications.schedule([{
|
||||||
* id: 1,
|
* id: 1,
|
||||||
* text: 'Multi Notification 1',
|
* text: 'Multi ILocalNotification 1',
|
||||||
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
|
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
|
||||||
* data: { secret:key }
|
* data: { secret:key }
|
||||||
* },{
|
* },{
|
||||||
* id: 2,
|
* id: 2,
|
||||||
* title: 'Local Notification Example',
|
* title: 'Local ILocalNotification Example',
|
||||||
* text: 'Multi Notification 2',
|
* text: 'Multi ILocalNotification 2',
|
||||||
* icon: 'http://example.com/icon.png'
|
* icon: 'http://example.com/icon.png'
|
||||||
* }]);
|
* }]);
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* // Schedule delayed notification
|
* // Schedule delayed notification
|
||||||
* LocalNotifications.schedule({
|
* LocalNotifications.schedule({
|
||||||
* text: 'Delayed Notification',
|
* text: 'Delayed ILocalNotification',
|
||||||
* at: new Date(new Date().getTime() + 3600),
|
* at: new Date(new Date().getTime() + 3600),
|
||||||
* led: 'FF0000',
|
* led: 'FF0000',
|
||||||
* sound: null
|
* sound: null
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
* @interfaces
|
||||||
|
* ILocalNotification
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'LocalNotifications',
|
pluginName: 'LocalNotifications',
|
||||||
@ -54,21 +137,21 @@ export class LocalNotifications {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Schedules a single or multiple notifications
|
* Schedules a single or multiple notifications
|
||||||
* @param options {Notification | Array<Notification>} optional
|
* @param options {Notification | Array<ILocalNotification>} optional
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
static schedule(options?: Notification | Array<Notification>): void { }
|
static schedule(options?: ILocalNotification | Array<ILocalNotification>): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a previously scheduled notification. Must include the id in the options parameter.
|
* Updates a previously scheduled notification. Must include the id in the options parameter.
|
||||||
* @param options {Notification} optional
|
* @param options {ILocalNotification} optional
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
sync: true
|
sync: true
|
||||||
})
|
})
|
||||||
static update(options?: Notification): void { }
|
static update(options?: ILocalNotification): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears single or multiple notifications
|
* Clears single or multiple notifications
|
||||||
@ -154,47 +237,47 @@ export class LocalNotifications {
|
|||||||
/**
|
/**
|
||||||
* Get a notification object
|
* Get a notification object
|
||||||
* @param notificationId {any} The id of the notification to get
|
* @param notificationId {any} The id of the notification to get
|
||||||
* @returns {Promise<Notification>}
|
* @returns {Promise<ILocalNotification>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static get(notificationId: any): Promise<Notification> { return; }
|
static get(notificationId: any): Promise<ILocalNotification> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a scheduled notification object
|
* Get a scheduled notification object
|
||||||
* @param notificationId {any} The id of the notification to get
|
* @param notificationId {any} The id of the notification to get
|
||||||
* @returns {Promise<Notification>}
|
* @returns {Promise<ILocalNotification>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static getScheduled(notificationId: any): Promise<Notification> { return; }
|
static getScheduled(notificationId: any): Promise<ILocalNotification> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a triggered notification object
|
* Get a triggered notification object
|
||||||
* @param notificationId The id of the notification to get
|
* @param notificationId The id of the notification to get
|
||||||
* @returns {Promise<Notification>}
|
* @returns {Promise<ILocalNotification>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static getTriggered(notificationId: any): Promise<Notification> { return; }
|
static getTriggered(notificationId: any): Promise<ILocalNotification> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all notification objects
|
* Get all notification objects
|
||||||
* @returns {Promise<Array<Notification>>}
|
* @returns {Promise<Array<ILocalNotification>>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static getAll(): Promise<Array<Notification>> { return; }
|
static getAll(): Promise<Array<ILocalNotification>> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all scheduled notification objects
|
* Get all scheduled notification objects
|
||||||
* @returns {Promise<Array<Notification>>}
|
* @returns {Promise<Array<ILocalNotification>>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static getAllScheduled(): Promise<Array<Notification>> { return; }
|
static getAllScheduled(): Promise<Array<ILocalNotification>> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all triggered notification objects
|
* Get all triggered notification objects
|
||||||
* @returns {Promise<Array<Notification>>}
|
* @returns {Promise<Array<ILocalNotification>>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
static getAllTriggered(): Promise<Array<Notification>> { return; }
|
static getAllTriggered(): Promise<Array<ILocalNotification>> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register permission to show notifications if not already granted.
|
* Register permission to show notifications if not already granted.
|
||||||
@ -223,86 +306,3 @@ export class LocalNotifications {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Notification {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
|
|
||||||
* Default: 0
|
|
||||||
*/
|
|
||||||
id?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* First row of the notification
|
|
||||||
* Default: Empty string (iOS) or the app name (Android)
|
|
||||||
*/
|
|
||||||
title?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Second row of the notification
|
|
||||||
* Default: Empty string
|
|
||||||
*/
|
|
||||||
text?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year
|
|
||||||
* Default: 0 (which means that the system triggers the local notification once)
|
|
||||||
*/
|
|
||||||
every?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
|
|
||||||
* Default: now ~ new Date()
|
|
||||||
*/
|
|
||||||
at?: any;
|
|
||||||
firstAt?: any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android)
|
|
||||||
* Default: 0 (which means don't show a number)
|
|
||||||
*/
|
|
||||||
badge?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Uri of the file containing the sound to play when an alert is displayed
|
|
||||||
* Default: res://platform_default
|
|
||||||
*/
|
|
||||||
sound?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Arbitrary data, objects will be encoded to JSON string
|
|
||||||
* Default: null
|
|
||||||
*/
|
|
||||||
data?: any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ANDROID ONLY
|
|
||||||
* Uri of the icon that is shown in the ticker and notification
|
|
||||||
* Default: res://icon
|
|
||||||
*/
|
|
||||||
icon?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ANDROID ONLY
|
|
||||||
* Uri of the resource (only res://) to use in the notification layouts. Different classes of devices may return different sizes
|
|
||||||
* Default: res://ic_popup_reminder
|
|
||||||
*/
|
|
||||||
smallIcon?: string;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ANDROID ONLY
|
|
||||||
* Ongoing notifications differ from regular notifications in the following ways:
|
|
||||||
* - They are sorted above the regular notifications in the notification panel
|
|
||||||
* - They do not have an 'X' close button, and are not affected by the "Clear all" button
|
|
||||||
* Default: false
|
|
||||||
*/
|
|
||||||
ongoing?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ANDROID ONLY
|
|
||||||
* ARGB value that you would like the LED on the device to blink
|
|
||||||
* Default: FFFFFF
|
|
||||||
*/
|
|
||||||
led?: string;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user