Push integration with Huawei

On May 19, Google decided to end with Huawei those businesses that require hardware and software transfer, less those covered by open source licenses. This means that the devices manufactured as of this date will not have Google services such as the Play Store, although it does have the equivalent, the Huawei App Gallery.

At EMMA, we have modified our SDK to adapt it to the Huawei app store. In order to measure the attribution as well as allow the sending of Push notifications through its service.

This guide shows how to integrate push notifications with Huawei, if you are installing our SDK from scratch take a look at our guide to see how to integrate push notifications on Android.

To carry out integration, follow these steps:

  1. Add dependencies
  2. Add the service to the AndroidManifest
  3. Get credentials

 

Add dependencies

  1. The first thing to do is add the dependencies to the project's build.gradle.

  2. Next we add the HMS dependencies to the app. The ads-identifier dependency allows obtaining the advertising identifier used in Huawei. The push dependency allows the use of the HMS service for push notifications.

     

Note

HMS service integration supports FCM integration into the EMMA SDK. The minimum supported Android version for HMS integration is Android 19.

 

 

Add the service to the AndroidManifest

  1. The following service must be added to the AndroidManifest.xml:

 

Get credentials

  1. To get the credentials you first have to create an account at developer.huawei.com and become a developer.

  2. Once an account is created, an application must be added in Huawei AppGallery Connect. The app is created in draft mode, to do the push integration is enough.

  3. Once the app is created, we can activate the Push Kit in the develop section. Information about the app will appear within Project Settings.Captura_de_pantalla_2020-06-29_a_las_18.21.30_censored.jpg
    It is necessary to add the fingerprint of the certificate that is used for the signature of the app.

  4. Download the agconnect-services.json and add it to / app. In this way, the HMS service will be able to authenticate the app.
  5. We add the appId and appSecret in the app preferences section in the EMMA dashboard.

    Captura_de_pantalla_2020-06-29_a_las_18.37.42.png

  6. Lastly, we compiled the app and can now send push notifications to Huawei devices.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.