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:
The first thing to do is add the dependencies to the project's build.gradle.
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.
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
The following service must be added to the AndroidManifest.xml:
To get the credentials you first have to create an account at developer.huawei.com and become a developer.
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.
Once the app is created, we can activate the Push Kit in the develop section. Information about the app will appear within Project Settings.
It is necessary to add the fingerprint of the certificate that is used for the signature of the app.
- Download the agconnect-services.json and add it to / app. In this way, the HMS service will be able to authenticate the app.
- We add the appId and appSecret in the app preferences section in the EMMA dashboard.
Lastly, we compiled the app and can now send push notifications to Huawei devices.