Cordova huawei Push Plugin
npm install cordova-hms-pushshell
cordova plugin add cordova-hms-push
`
Open the root project level build.gradle, ensure the following settings added
buildscript {
repositories {
maven { url 'http://developer.huawei.com/repo/' }
}
dependencies {
classpath 'com.huawei.agconnect:agcp:1.0.0.300'
}
}
How to use
$3
`javascript
cordova.plugins.hmspush.init();
`
$3
`javascript
document.addEventListener('hmspush.tokenRegistered', function (event) {
console.log(event.token)
}.bind(this), false);
`
You can get the token value by event.token`