This plugin is created to serve native HMS Push Kit functionality on the Android platform.
It supports handy features like triggering custom onNotificationOpened
event to catch notification related data on JS layer when user clicks and opens push notification sent from Huawei Push Kit Server.
Follow official codelab for HMS Core enablement.
- Add plugin to your projects.
cordova plugin add https://github.com/onurkenis/cordova-hms-push-plugin.git
- Add following line to the activity in src/android where you configured to open after user notification click.
PushUtils.setIntentData(bundle);
- Add event listener to deviceready Event Handler and get notification data in JS when app is opened.
document.addEventListener('onNotificationOpened', function (notification) {
console.log("onNotificationOpened Title: " + notification.detail.title);
console.log("onNotificationOpened Body: " + notification.detail.body);
}, false);
This part will be updated.
This part will be updated.
Commit messages must comply with conventional commits. Otherwise commitlint will complain.
Thanks to commitizen, npm run commit
command can be used to create commit messages complying with conventional commits.
Don't forget to install dependencies before to use it with npm install
.