> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-sdk-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring HMS Push Kit

<Check>
  * Ensure that you have configured Push Kit on your application.\
    For more information, refer to [HMS Push Kit documentation](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/service-introduction-0000001050040060).
  * Ensure that you configure MoEngage SDK for receiving push notifications.
</Check>

# SDK Installation

## Installing Using BOM

Integration using BOM is the recommended way of integration; refer to the [Install Using BOM](/android-sdk/sdk-integration/basic-integration/Install-Using-BOM) document to configure BOM if not done already. Once you have configured the BOM add the dependency in the ***app/build.gradle*** file as shown below

<CodeGroup>
  ```Groovy build.gradle theme={"theme":{"light":"github-light","dark":"github-dark"}}
  dependencies {
        ...
        implementation("com.moengage:hms-pushkit")
  }
  ```
</CodeGroup>

Alternatively, you can add the dependency using Artifact ID as described in [Installation using Artifact ID](/android-sdk/sdk-integration/advanced-or-optional/installing-sdk-using-artifact-id#In-App). However, installation using BOM is the recommended approach as installing using Artifact ID may lead to version mismatch if mapped incorrectly. 

# Push Token Management

When using MoEngage SDK, you can either register for token and pass it on to the MoEngage SDK or simply let MoEngage SDK register for Push Token.

## Token Registration Handled by Application

If your application is registering for Push Notification, use the below API to pass the Push token to the MoEngage SDK.

<CodeGroup>
  ```kotlin Kotlin theme={"theme":{"light":"github-light","dark":"github-dark"}}
  MoEPushKitHelper.getInstance().passPushToken(context, token)
  ```

  ```java Java theme={"theme":{"light":"github-light","dark":"github-dark"}}
  MoEPushKitHelper.getInstance().passPushToken(context, token);
  ```
</CodeGroup>

## Token Registration Handled by MoEngage

By default, the MoEngage SDK does not register for push tokens. You can enable the token registration using the [configurePushKit()](https://moengage.github.io/android-api-reference/core/com.moengage.core/\[android-jvm]-mo-engage/-builder/configure-push-kit.html) API in the [MoEngage.Builder](https://moengage.github.io/android-api-reference/core/com.moengage.core/\[android-jvm]-mo-engage/-builder/index.html) while initializing the SDK

<CodeGroup>
  ```kotlin Kotlin theme={"theme":{"light":"github-light","dark":"github-dark"}}
  val moEngage = MoEngage.Builder(this, "XXXXXXXX")
       .configurePushKit(PushKitConfig(true))
       .build()
  MoEngage.initialiseDefaultInstance(moEngage)
  ```

  ```java Java theme={"theme":{"light":"github-light","dark":"github-dark"}}
  MoEngage moEngage = new MoEngage.Builder(this, "XXXXXXXXXX")
       .configurePushKit(new PushKitConfig(true))
       .build();
  MoEngage.initialiseDefaultInstance(moEngage);
  ```
</CodeGroup>

Add the below Service in your application's Manifest file.

<CodeGroup>
  ```xml AndroidManifest.xml theme={"theme":{"light":"github-light","dark":"github-dark"}}
  <service
      android:name="com.moengage.hms.pushkit.MoEPushKitMessageService"
      android:exported="false">
    <intent-filter>
      <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
    </intent-filter>
  </service>>
  ```
</CodeGroup>

When MoEngage SDK handles push registration, it optionally provides a callback to the Application whenever a new token is registered, or the token is refreshed.\
An application can get this callback by implementing the [TokenAvailableListener](https://moengage.github.io/android-api-reference/pushbase/com.moengage.pushbase.listener/-token-available-listener/index.html) interface and registering the listener using [MoEPushKitHelper.getInstance().addTokenListener()](https://moengage.github.io/android-api-reference/hms-pushkit/com.moengage.hms.pushkit/-mo-e-push-kit-helper/add-token-listener.html) API.

<Info>
  To use Push Kit, you need to update the *moe-android-sdk* to 10.3.00 or above.
</Info>

# Configure Your Account on MoEngage

Now you have set up Huawei Push on MoEngage SDK. Proceed to [configuring Huawei Push on MoEngage dashboard](/android-sdk/push/optional/push-amp-plus/configuring-huawei-push-on-mo-engage).
