Skip to content

Commit

Permalink
feat(jpush): integrate jpush with native ngx
Browse files Browse the repository at this point in the history
  • Loading branch information
pengkobe committed Nov 7, 2018
1 parent 58671ea commit 9d75ecb
Show file tree
Hide file tree
Showing 6 changed files with 287 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { BackgroundMode } from '@ionic-native/background-mode/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';

// import { JPush } from '@jiguang-ionic/jpush';
import { JPush } from '../nativewrapper/jpush/ngx';

import { CoreModule } from './core/core.module';
import { SharedModule } from './shared/shared.module';
Expand All @@ -26,7 +26,7 @@ import { StoreModule } from '@ngrx/store';
import { MyApp } from './app.component';

import { MyErrorHandler } from './error.handler';
// import { RavenErrorHandler } from './raven-error-handler.';
import { RavenErrorHandler } from './raven-error-handler.';

@NgModule({
declarations: [MyApp],
Expand All @@ -35,7 +35,6 @@ import { MyErrorHandler } from './error.handler';
CoreModule,
SharedModule,
BrowserModule,
// JPush,
IonicStorageModule.forRoot(),
IonicModule.forRoot(),
StoreModule.forRoot({}),
Expand All @@ -49,6 +48,7 @@ import { MyErrorHandler } from './error.handler';
SplashScreen,
BackgroundMode,
File,
JPush,
FileTransfer,
FileOpener,
Insomnia,
Expand Down
69 changes: 69 additions & 0 deletions src/nativewrapper/jpush/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { IonicNativePlugin } from '@ionic-native/core';
export interface TagOptions {
sequence: number;
tags?: string[];
}
export interface AliasOptions {
sequence: number;
alias?: string;
}
export declare class JPushOriginal extends IonicNativePlugin {
init(): Promise<any>;
setDebugMode(enable: boolean): Promise<any>;
getRegistrationID(): Promise<any>;
stopPush(): Promise<any>;
resumePush(): Promise<any>;
isPushStopped(): Promise<any>;
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>;
/**
* @param params { sequence: number, tag: string }
*/
checkTagBindState(params: object): Promise<any>;
setAlias(params: AliasOptions): Promise<any>;
deleteAlias(params: AliasOptions): Promise<any>;
getAlias(params: AliasOptions): Promise<any>;
/**
* 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>;
setBadge(badge: number): Promise<any>;
resetBadge(): Promise<any>;
setApplicationIconBadgeNumber(badge: number): Promise<any>;
getApplicationIconBadgeNumber(): Promise<any>;
addLocalNotificationForIOS(delayTime: number, content: string, badge: number, identifierKey: string, extras?: object): Promise<any>;
deleteLocalNotificationWithIdentifierKeyInIOS(identifierKey: string): Promise<any>;
addDismissActions(actions: object[], categoryId: string): Promise<any>;
addNotificationActions(actions: object[], categoryId: string): Promise<any>;
setLocation(latitude: number, longitude: number): Promise<any>;
startLogPageView(pageName: string): Promise<any>;
stopLogPageView(pageName: string): Promise<any>;
beginLogPageView(pageName: string, duration: number): Promise<any>;
getConnectionState(): Promise<any>;
setBasicPushNotificationBuilder(): Promise<any>;
setCustomPushNotificationBuilder(): Promise<any>;
clearAllNotification(): Promise<any>;
clearNotificationById(id: number): Promise<any>;
setLatestNotificationNum(num: number): Promise<any>;
addLocalNotification(builderId: number, content: string, title: string, notificationId: number, broadcastTime: number, extras?: string): Promise<any>;
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: string[], startHour: number, endHour: number): Promise<any>;
}

export declare const JPush: JPushOriginal;
69 changes: 69 additions & 0 deletions src/nativewrapper/jpush/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9d75ecb

Please sign in to comment.