2017-12-07 21:35:43 +08:00
|
|
|
import { IonicNativePlugin } from '@ionic-native/core';
|
2017-12-11 12:31:54 +08:00
|
|
|
export interface TagOptions {
|
|
|
|
sequence: number;
|
|
|
|
tags?: Array<string>;
|
|
|
|
}
|
|
|
|
export interface AliasOptions {
|
|
|
|
sequence: number;
|
|
|
|
alias?: string;
|
|
|
|
}
|
2019-02-23 23:58:23 +08:00
|
|
|
/**
|
|
|
|
* @name jpush
|
|
|
|
* @description
|
|
|
|
* This plugin does something
|
|
|
|
*
|
|
|
|
* @usage
|
|
|
|
* ```typescript
|
|
|
|
* import { jpush } from '@ionic-native/jpush';
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* constructor(private jpush: jpush) { }
|
|
|
|
*
|
|
|
|
* ...
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* this.jpush.functionName('Hello', 123)
|
|
|
|
* .then((res: any) => console.log(res))
|
|
|
|
* .catch((error: any) => console.error(error));
|
|
|
|
*
|
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
export declare class JPushOriginal extends IonicNativePlugin {
|
|
|
|
/**
|
|
|
|
* This function does something
|
|
|
|
* @param arg1 {string} Some param to configure something
|
|
|
|
* @param arg2 {number} Another param to configure something
|
|
|
|
* @return {Promise<any>} Returns a promise that resolves when something happens
|
|
|
|
*/
|
|
|
|
functionName(arg1: string, arg2: number): Promise<any>;
|
|
|
|
init(): void;
|
|
|
|
setDebugMode(enable: boolean): void;
|
2017-12-07 21:35:43 +08:00
|
|
|
getRegistrationID(): Promise<any>;
|
|
|
|
stopPush(): Promise<any>;
|
|
|
|
resumePush(): Promise<any>;
|
|
|
|
isPushStopped(): Promise<any>;
|
2017-12-11 12:31:54 +08:00
|
|
|
setTags(params: TagOptions): Promise<any>;
|
|
|
|
addTags(params: TagOptions): Promise<any>;
|
|
|
|
deleteTags(params: TagOptions): Promise<any>;
|
|
|
|
cleanTags(params: TagOptions): Promise<any>;
|
|
|
|
getAllTags(params: TagOptions): Promise<any>;
|
2017-12-07 21:35:43 +08:00
|
|
|
/**
|
|
|
|
* @param params { sequence: number, tag: string }
|
|
|
|
*/
|
|
|
|
checkTagBindState(params: object): Promise<any>;
|
2017-12-11 12:31:54 +08:00
|
|
|
setAlias(params: AliasOptions): Promise<any>;
|
|
|
|
deleteAlias(params: AliasOptions): Promise<any>;
|
|
|
|
getAlias(params: AliasOptions): Promise<any>;
|
2017-12-07 21:35:43 +08:00
|
|
|
/**
|
|
|
|
* Determinate whether the application notification has been opened.
|
|
|
|
*
|
|
|
|
* iOS: 0: closed; >1: opened.
|
|
|
|
* UIRemoteNotificationTypeNone = 0,
|
|
|
|
* UIRemoteNotificationTypeBadge = 1 << 0,
|
|
|
|
* UIRemoteNotificationTypeSound = 1 << 1,
|
|
|
|
* UIRemoteNotificationTypeAlert = 1 << 2,
|
|
|
|
* UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3
|
|
|
|
*
|
|
|
|
* Android: 0: closed; 1: opened.
|
|
|
|
*/
|
|
|
|
getUserNotificationSettings(): Promise<any>;
|
|
|
|
clearLocalNotifications(): Promise<any>;
|
2019-02-23 23:58:23 +08:00
|
|
|
setBadge(badge: number): void;
|
|
|
|
resetBadge(): void;
|
|
|
|
setApplicationIconBadgeNumber(badge: number): void;
|
2017-12-07 21:35:43 +08:00
|
|
|
getApplicationIconBadgeNumber(): Promise<any>;
|
2019-02-23 23:58:23 +08:00
|
|
|
addLocalNotificationForIOS(delayTime: number, content: string, badge: number, identifierKey: string, extras?: object): void;
|
|
|
|
deleteLocalNotificationWithIdentifierKeyInIOS(identifierKey: string): void;
|
|
|
|
addDismissActions(actions: Array<object>, categoryId: string): void;
|
|
|
|
addNotificationActions(actions: Array<object>, categoryId: string): void;
|
|
|
|
setLocation(latitude: number, longitude: number): void;
|
|
|
|
startLogPageView(pageName: string): void;
|
|
|
|
stopLogPageView(pageName: string): void;
|
|
|
|
beginLogPageView(pageName: string, duration: number): void;
|
2017-12-07 21:35:43 +08:00
|
|
|
getConnectionState(): Promise<any>;
|
|
|
|
setBasicPushNotificationBuilder(): Promise<any>;
|
|
|
|
setCustomPushNotificationBuilder(): Promise<any>;
|
|
|
|
clearAllNotification(): Promise<any>;
|
|
|
|
clearNotificationById(id: number): Promise<any>;
|
|
|
|
setLatestNotificationNum(num: number): Promise<any>;
|
2017-12-11 12:31:54 +08:00
|
|
|
addLocalNotification(builderId: number, content: string, title: string, notificationId: number, broadcastTime: number, extras?: string): Promise<any>;
|
2017-12-07 21:35:43 +08:00
|
|
|
removeLocalNotification(notificationId: number): Promise<any>;
|
|
|
|
reportNotificationOpened(msgId: number): Promise<any>;
|
|
|
|
requestPermission(): Promise<any>;
|
|
|
|
setSilenceTime(startHour: number, startMinute: number, endHour: number, endMinute: number): Promise<any>;
|
|
|
|
setPushTime(weekdays: Array<string>, startHour: number, endHour: number): Promise<any>;
|
|
|
|
}
|
2019-02-23 23:58:23 +08:00
|
|
|
|
|
|
|
export declare const JPush: JPushOriginal;
|