ltg-jpush
Version:
JPush for cordova plugin
211 lines (162 loc) • 5 kB
text/typescript
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export interface TagOptions {
sequence: number;
tags?: Array<string>;
}
export interface AliasOptions {
sequence: number;
alias?: string;
}
export class JPush extends IonicNativePlugin {
init(): void { }
setDebugMode(enable: boolean): void { }
getRegistrationID(): Promise<any> { return; }
stopPush(): Promise<any> { return; }
resumePush(): Promise<any> { return; }
isPushStopped(): Promise<any> { return; }
setTags(params: TagOptions): Promise<any> { return; }
addTags(params: TagOptions): Promise<any> { return; }
deleteTags(params: TagOptions): Promise<any> { return; }
cleanTags(params: TagOptions): Promise<any> { return; }
getAllTags(params: TagOptions): Promise<any> { return; }
/**
* @param params { sequence: number, tag: string }
*/
checkTagBindState(params: object): Promise<any> { return; }
setAlias(params: AliasOptions): Promise<any> { return; }
deleteAlias(params: AliasOptions): Promise<any> { return; }
getAlias(params: AliasOptions): Promise<any> { return; }
/**
* 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> { return; }
clearLocalNotifications(): Promise<any> { return; }
// iOS API - start
setBadge(badge: number): void { }
resetBadge(): void { }
setApplicationIconBadgeNumber(badge: number): void { }
getApplicationIconBadgeNumber(): Promise<any> { return; }
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 { return; }
stopLogPageView(pageName: string): void { return; }
beginLogPageView(pageName: string, duration: number): void { return; }
// iOS API - end
// Android API - start
getConnectionState(): Promise<any> { return; }
setBasicPushNotificationBuilder(): Promise<any> { return; }
setCustomPushNotificationBuilder(): Promise<any> { return; }
clearAllNotification(): Promise<any> { return; }
clearNotificationById(id: number): Promise<any> { return; }
setLatestNotificationNum(num: number): Promise<any> { return; }
addLocalNotification(builderId: number, content: string, title: string, notificationId: number, broadcastTime: number, extras?: string): Promise<any> { return; }
removeLocalNotification(notificationId: number): Promise<any> { return; }
reportNotificationOpened(msgId: number): Promise<any> { return; }
requestPermission(): Promise<any> { return; }
setSilenceTime(startHour: number, startMinute: number, endHour: number, endMinute: number): Promise<any> { return; }
setPushTime(weekdays: Array<string>, startHour: number, endHour: number): Promise<any> { return; }
// Android API - end
}