Ionic Jpush Save

基于ionic3 和 ionic-native3 的极光推送封装

Project README

ionic3-jpush

npm

基于ionic3 和 ionic-native3 的极光推送封装

更新说明

官方phonegap插件jpush-phonegap-plugin更新了Api。 ionic3-jpush 1.2.0 需要jpush-phonegap-plugin >= 3.2.4。

若你的项目适用jpush-phonegap-plugin < 3.24 请使用 ionic3-jpush 1.1.0 npm i [email protected] --save

以下Api参数发生变化

Alias API

  • setAlias
  • deleteAlias
  • getAlias

Tag API

  • setTags
  • addTags
  • deleteTags
  • cleanTags
  • getAllTags
  • checkTagBindState

如何使用

  1. 安装官方Cordova插件
ionic plugin add jpush-phonegap-plugin --variable APP_KEY=your_jpush_appkey
  1. 安装模块ionic3-jpush
npm i ionic3-jpush -S
  1. app.module.ts中引入,并加入到@NgModuleproviders
import { JPush } from 'ionic3-jpush';

@NgModule({
  ...
  providers: [ JPush ],
})
export class AppModule { }

  1. 在Component中调用方法
//...
import { JPush } from 'ionic3-jpush';

@Component({
    template: `
        <ion-nav [root]="rootPage"></ion-nav>`
})
export class MyApp {

  constructor (public jPush: JPush){

    this.jPush.getRegistrationID().then(regid => {
      console.log(regid)
    })

  }
}

Api说明

Open Source Agenda is not affiliated with "Ionic Jpush" Project. README Source: lh4111/ionic-jpush
Stars
46
Open Issues
0
Last Commit
6 years ago
Repository

Open Source Agenda Badge

Open Source Agenda Rating