极光推送 官网:https://www.jiguang.cn/push 注册账号,创建应用,记录AppKey, 应用包名与ioinic 包名一致(config.xml 下 widget 的id)
ionic 安装 cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_jpush_appkey
安装 npm install --save @jiguang-ionic/jpush
在 app.module.ts 文件中,导入,然后添加到 服务(providers)中。
import { JPush } from '@jiguang-ionic/jpush';
...
providers: [
...
JPush,
...
]
app.component.ts
import { JPush } from '@jiguang-ionic/jpush' // 极光推送
constructor(
platform: Platform,
splashScreen: SplashScreen,
jpush:JPush
) {
platform.ready().then(() => {
splashScreen.hide()
jpush.init();
jpush.setDebugMode(true);
})
}
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有