Huawei Cordova SDK Setup

Follow these instructions if your app is distributed on the Huawei AppGallery.

Step 1. Requirements

Step 2. Setup the OneSignal Cordova SDK

Follow the OneSignal Cordova SDK setup guide. Firebase / Google setup not required for app builds released to the Huawei AppGallery.

Step 3. Huawei Setup

Follow the Huawei Push Kit Cordova Getting Started guide.

When following the Integrating the Plugin setup, after downloading the plugin, change the downloaded plugin's plugin.xml file to remove the CordovaHMSMessageService from the AndroidManifest.xml.

Step 4. Huawei Location Service (Optional)

4.1 Add implementation 'com.huawei.hms:location:<HUAWEI HMS VERSION #> to your app build.gradle's dependencies section.
4.2 Make sure to also add the location permission to your AndroidManifest.xml if you don't have this already

Notes/Resources

This is an example Cordova project integrating the Huawei Cordova Plugin.

HMS error code reference to help debug logs and successfully integrate HMS Core SDK with the OneSignal SDK.