jpush-phonegap-plugin/index.ts

172 lines
4.5 KiB
TypeScript
Raw Normal View History

2017-11-27 20:36:41 +08:00
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
2017-12-07 21:32:48 +08:00
export interface TagOptions {
sequence: number;
tags?: Array<string>;
}
export interface AliasOptions {
sequence: number;
alias?: string;
}
2017-11-27 20:36:41 +08:00
@Plugin({
pluginName: 'JPush',
plugin: 'jpush-phonegap-plugin',
2017-12-08 21:35:42 +08:00
pluginRef: 'plugins.jPushPlugin',
2017-11-27 20:36:41 +08:00
repo: 'https://github.com/jpush/jpush-phonegap-plugin',
install: 'ionic cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_app_key',
installVariables: ['APP_KEY'],
platforms: ['Android', 'iOS']
})
@Injectable()
export class JPush extends IonicNativePlugin {
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
init(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
setDebugMode(enable: boolean): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
getRegistrationID(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
stopPush(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
resumePush(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
isPushStopped(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
setTags(params: TagOptions): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
2017-12-07 21:32:48 +08:00
@Cordova()
addTags(params: TagOptions): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
2017-12-07 21:32:48 +08:00
@Cordova()
deleteTags(params: TagOptions): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
2017-12-07 21:32:48 +08:00
@Cordova()
cleanTags(params: TagOptions): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
2017-12-07 21:32:48 +08:00
@Cordova()
getAllTags(params: TagOptions): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
/**
* @param params { sequence: number, tag: string }
*/
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
checkTagBindState(params: object): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
setAlias(params: AliasOptions): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
2017-12-07 21:32:48 +08:00
@Cordova()
deleteAlias(params: AliasOptions): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
2017-12-07 21:32:48 +08:00
@Cordova()
getAlias(params: AliasOptions): Promise<any> { return; }
2017-11-27 20:36:41 +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.
*/
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
getUserNotificationSettings(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
clearLocalNotifications(): Promise<any> { return; }
// iOS API - start
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
setBadge(badge: number): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
resetBadge(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
setApplicationIconBadgeNumber(badge: number): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
getApplicationIconBadgeNumber(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-12-08 21:35:42 +08:00
addLocalNotificationForIOS(delayTime: number, content: string, badge: number, identifierKey: string, extras?: string): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
deleteLocalNotificationWithIdentifierKeyInIOS(identifierKey: string): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
addDismissActions(actions: Array<object>, categoryId: string): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
addNotificationActions(actions: Array<object>, categoryId: string): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
setLocation(latitude: number, longitude: number): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
startLogPageView(pageName: string): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
stopLogPageView(pageName: string): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
beginLogPageView(pageName: string, duration: number): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
// iOS API - end
// Android API - start
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
getConnectionState(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
setBasicPushNotificationBuilder(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
setCustomPushNotificationBuilder(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
clearAllNotification(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
clearNotificationById(id: number): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
setLatestNotificationNum(num: number): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
addLocalNotification(builderId: number, content: string, title: string, notificationId: number, broadcastTime: number, extras?: string): Promise<any> { return; }
2017-11-27 20:36:41 +08:00
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
removeLocalNotification(notificationId: number): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
reportNotificationOpened(msgId: number): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
requestPermission(): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
setSilenceTime(startHour: number, startMinute: number, endHour: number, endMinute: number): Promise<any> { return; }
2017-12-07 21:32:48 +08:00
@Cordova()
2017-11-27 20:36:41 +08:00
setPushTime(weekdays: Array<string>, startHour: number, endHour: number): Promise<any> { return; }
// Android API - end
2017-12-07 21:32:48 +08:00
}