Huawei Push Kit integration

πŸ“˜

Available upon request

Please contact your Customer Success Manager for access and the Leanplum team will enable it for you.

Note that Huawei Push Kit integration requires using Leanplum Android SDK version 5.9.0 and above.

Huawei console

  1. Create a Huawei developer account from the Huawei Website.

  2. Once you have registered, create a project that will contain all your application variants. Use the AppGallery Connect website.

11961196
  1. Next create an application inside that project and during the setup download the agconnect-services.json file because it will be needed at a later step.
961961
  1. Enter your certificate fingerprint of your app's signing certificate.
856856
  1. Enable Push Kit to allow push messaging.
12551255

SDK integration

You can now proceed with the steps to integrate leanplum-hms library into your Android application:

  1. Add a library dependency:
implementation 'com.leanplum:leanplum-hms:5.9.0'

πŸ“˜

All Leanplum dependencies used (leanplum-core, leanplum-fcm, leanplum-push...) must be set on the same version. We release all of the packages at the same time, so the correct version will always be available.

We migrated our packages from jCenter to Maven Central. Ensure you have included mavenCentral() in your repositories in build.gradle file, if you have not already.

  1. Copy agconnect-services.json, which was downloaded in a previous step, to your project/app directory.
  2. Add dependency for the agconnect plugin in your build.gradle file:
buildscript {
    repositories {
        maven {
            url 'https://developer.huawei.com/repo/'
        }
    }
    dependencies {
        classpath 'com.huawei.agconnect:agcp:1.5.2.300'
    }
}
  1. Apply agconnect plugin in your app/build.gradle file:
apply plugin: 'com.huawei.agconnect'
  1. Setup minimum Android SDK, required by Huawei messaging libraries:
android {
    defaultConfig {
        minSdkVersion 18
    }
}
  1. In the Leanplum dashboard, go to the Push Notifications tab in your App Settings and enter/paste your Huawei App ID and Huawei App Secret. They correspond to Client ID and Client Secret under App Information in your Huawei Console.