
## Enable integration in the Synerise platform

Before you start integrating Huawei services in your app, you must configure the integration in Synerise platform. For instructions, see ["Huawei integration"](/docs/settings/tool/huawei-integration).

## Configuration
In order to integrate Huawei Mobile Services with Synerise, you must add `.mesaggingServiceType(MessagingServiceType)` to your `Synerise.Builder`.

We recommend passing `MessagingServiceType.HMS` as an argument when you build the app for AppGallery.


<div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

More information about `Synerise.Builder` is available in ["Configuration"](/developers/mobile-sdk/installation-and-configuration/android#configuration).

</div></div></div>


## Implementing Huawei notifications in applications

1. Register your service in the AndroidManifest:
   
   <pre><code class="language-XML">&lt;application
           android:name=".App"
           android:allowBackup="true"
           android:icon="@mipmap/ic_launcher"
           android:label="@string/app_name"
           android:roundIcon="@mipmap/ic_launcher_round"
           android:supportsRtl="true"
           android:theme="@style/AppTheme"&gt;
           ...
           &lt;service
           android:name=".service.MyPushService"
           android:exported="false"&gt;
           &lt;intent-filter&gt;
               &lt;action android:name="com.huawei.push.action.MESSAGING_EVENT" /&gt;
           &lt;/intent-filter&gt;
       &lt;/service&gt;
       &lt;/application&gt;</code></pre>


2. In `onRegisterForPush`, pass the huaweiToken using the [`Client.registerForPush(token, pushAgreement)` method](/developers/mobile-sdk/method-reference/android/campaigns#register-for-push-notifications).
3. Add the Huawei registration method:  
    
   <div class="content-tabs code-tabs" data-tab-group="tabgrp-607">
   <div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-607-0" data-tab-group="tabgrp-607" data-tab-active="true">kotlin</button></div>

   <div class="tab-panel" data-tab-id="tabgrp-607-0" data-tab-group="tabgrp-607" data-tab-active="true">

   ```kotlin
   override fun onNewToken(p0: String?, p1: Bundle?) {
       super.onNewToken(p0, p1)
       val call = Client.registerForPush(p0!!, true)
       call.execute(
           {
               Log.i(TAG, "Register for Push succeed: $p0")
           }
       ) { apiError: Any? ->
           Log.i(TAG, "Register for push failed:" + apiError.toString())
       }
       Log.i(TAG, p0!!)
       Log.i(TAG, "receive token: $p0")
   }
   ```

   </div>
   </div>

1. Pass the incoming push notification payload to the `Injector` in your `HmsMessageService` implementation:
   
   <div class="content-tabs code-tabs" data-tab-group="tabgrp-608">
   <div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-608-0" data-tab-group="tabgrp-608" data-tab-active="true">kotlin</button></div>

   <div class="tab-panel" data-tab-id="tabgrp-608-0" data-tab-group="tabgrp-608" data-tab-active="true">

   ```kotlin
   val scope = CoroutineScope(Dispatchers.IO + SupervisorJob())

       override fun onMessageReceived(p0: RemoteMessage?) {
           super.onMessageReceived(p0)
           val data: Map<String, String> = p0!!.dataOfMap
           scope.launch {
               Injector.handlePushPayload(data)
           }
       }
   ```

   </div>
   </div>



   <div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   For more information, visit [Huawei Codelab](https://developer.huawei.com/consumer/en/codelab/HMSPushKit/index.html#0).

   </div></div></div>



## Links and Deep Links

In order to implement links and deep links, refer to [this](/developers/mobile-sdk/campaigns/action-handling#handling-actions-from-campaigns-in-android) instruction.

## Configuring notification encryption

Instructions for encrypting push notifications are available [here](/developers/mobile-sdk/configuring-push-notifications/android#configure-notification-encryption).