Integrating Cordova Huawei Plugin
How to set up integration with Cordova Huawei plugin
1. Integrate Cordova plugin
Integrate Cordova plugin into your project following the steps described in the Integrating Cordova Plugin.
2. Configure Huawei via AppGallery Connect
2.1. Go to AppGallery Connect -> Projects List and select a project to configure.
2.2. Press agconnect-services.json in the App information section to download a configuration file.
![](https://docs.pushwoosh.com/~gitbook/image?url=https%3A%2F%2Fgblobscdn.gitbook.com%2Fassets%252F-LZcP-aO1PEwwePSSaCB%252F-MTou6i6FCC5AS3FKCRe%252F-MToudpq2nTR5f9SAbkG%252Fimage.png%3Falt%3Dmedia%26token%3D91041987-4011-40ed-9b6b-a29910257a20&width=768&dpr=4&quality=100&sign=4e2d4f4a&sv=1)
2.3. Put the downloaded file into your Android Studio project (YOUR_PROJECT/app/agconnect-services.json).
![](https://docs.pushwoosh.com/~gitbook/image?url=https%3A%2F%2Fgblobscdn.gitbook.com%2Fassets%252F-LZcP-aO1PEwwePSSaCB%252F-MTou6i6FCC5AS3FKCRe%252F-MTouhx8gre4n2LoWKmx%252Fimage.png%3Falt%3Dmedia%26token%3D632d6769-c623-4950-a6f3-f75be6e7f206&width=768&dpr=4&quality=100&sign=b96c59d1&sv=1)
3. Generate Signing Certificate Fingerprint
3.1. In Android Studio, go to View > Tool Windows > Gradle.
![](https://docs.pushwoosh.com/~gitbook/image?url=https%3A%2F%2Fgblobscdn.gitbook.com%2Fassets%252F-LZcP-aO1PEwwePSSaCB%252F-MTou6i6FCC5AS3FKCRe%252F-MToulyIY6wgiszNwQf4%252Fimage.png%3Falt%3Dmedia%26token%3D8f94245f-33b5-436f-a0ba-e55946427e68&width=768&dpr=4&quality=100&sign=575303f4&sv=1)
3.2. In the window opened, go to app > Tasks > android > signingReport.
![](https://docs.pushwoosh.com/~gitbook/image?url=https%3A%2F%2Fgblobscdn.gitbook.com%2Fassets%252F-LZcP-aO1PEwwePSSaCB%252F-MTou6i6FCC5AS3FKCRe%252F-MTov8I6SXElzjXdL0Z7%252Fimage.png%3Falt%3Dmedia%26token%3De1607e23-c6bc-4297-9042-9dc7aeb9087f&width=768&dpr=4&quality=100&sign=d3cb5161&sv=1)
3.3. Copy SHA-256 from your release keystore.
![](https://docs.pushwoosh.com/~gitbook/image?url=https%3A%2F%2Fgblobscdn.gitbook.com%2Fassets%252F-LZcP-aO1PEwwePSSaCB%252F-MTou6i6FCC5AS3FKCRe%252F-MTovB18os7yIsQlbzXT%252Fimage.png%3Falt%3Dmedia%26token%3D8c769a42-be8c-428e-a855-46f2e4b7b914&width=768&dpr=4&quality=100&sign=a57755c2&sv=1)
You can also add the SHA-256 from your debug keystore for testing purposes.
3.4. Select your project in AppGallery Connect Project List.
3.5. Paste the SHA-256 into the SHA-256 certificate fingerprint field.
Please be aware that fingerprint processing may take up to 10 minutes.
4. Configure Huawei in Pushwoosh
Follow the guide to configure the Huawei platform for your Pushwoosh project: Configure Huawei.
Add the agconnect-services.json to android/app.
5. Add Huawei repo
Add the maven repository { url 'https://developer.huawei.com/repo/' } to your project's android/repositories.gradle and android/app/repositories.gradle files.
6. Add dependencies
6.1. Add classpath "com.huawei.agconnect:agcp:1.2.1.301" to the android/build.gradle file of buildScript/dependencies.
6.2. Add apply plugin: 'com.huawei.agconnect' and implementation "com.huawei.hms:push:5.3.0.304" to android/app/build.gradle.
7. Enable push notifications
In your JavaScript code, add enableHuaweiPushNotifications before executing onDeviceReady:
Share your feedback with us
Your feedback helps us create a better experience, so we would love to hear from you if you have any issues during the SDK integration process. If you face any difficulties, please do not hesitate to share your thoughts with us via this form.
Last updated