npm install ionic serve ionic platfom add android ionic run android
通过 Cordova Plugins 安装,要求 Cordova CLI 5.0+:
cordova plugin add jpush-phonegap-plugin --variable API_KEY=your_jpush_appkey 或者直接通过 url 安装:
cordova plugin add https://github.com/jpush/jpush-phonegap-plugin.git --variable API_KEY=your_jpush_appkey 或下载到本地安装:
cordova plugin add Your_Plugin_Path --variable API_KEY=your_jpush_appkey
在ionic-native的基础上新增了JPUSH的调用方法
目前只实现了公共API部分 详情公共 API。
import { JPush } from 'ionic-native';
JPush.init().then(res => { alert(res) });
JPush.stopPush().then(res => { alert(res) });
JPush.isPushStopped().then(res => { alert(res) });
JPush.getRegistrationID().then(res => { alert(res) });
JPush.resumePush().then(res => { alert(res) });
JPush.setAlias(alias).then(res => { alert(res) });
JPush.setTags(tags).then(res => { alert(res) });
JPush.setTagsWithAlias(tags,alias).then(res => { alert(res) });
JPush.getUserNotificationSettings().then(res => { alert(res) });