> For the complete documentation index, see [llms.txt](https://docs.hackle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hackle.io/en/development-guide/react-native/push-message/rn-android-push-message.md).

# Android Push Message Integration

{% stepper %}
{% step %}
**Integrate Firebase Project**

To use push messages in your Android app, you need to configure the integration between your Hackle workspace and a Firebase project.

For details, refer to [Android FCM Integration](/en/external-link/crm-channels/fcm-integration.md).
{% endstep %}

{% step %}
**Integrate Firebase Cloud Messaging SDK**

Complete the Android app setup by referring to the [Firebase SDK Integration Guide](https://firebase.google.com/docs/android/setup) and the [Firebase Cloud Messaging Installation Guide](https://firebase.google.com/docs/cloud-messaging/android/client).
{% endstep %}

{% step %}
**Integrate with the Hackle SDK**

Refer to [SDK Integration](/en/development-guide/react-native.md) to add the Hackle SDK dependency and initialize the SDK.

The push token is automatically collected when the app launches.

{% hint style="info" %}
Once the SDK integration is complete, push tokens are automatically collected, and push reception and push click handling become available.
{% endhint %}
{% endstep %}

{% step %}
**Test Push Messages**

**Verify Token**

* You can verify the token configured on an Android device through the [User Identifier Guide](/en/development-guide/react-native/react-native-user-explorer.md).
* You can verify the Android push token assigned to a specific user through the [User Profile Guide](/en/user-view/user-profile.md).

**Test Sending**

* Refer to the [Push Message Test Send Guide](/en/crm-marketing/push-message-guide/create-campaign.md#id-3-1) to verify push messages on an Android device.
  {% endstep %}

{% step %}
**Push Message Reception**

When a push is received, an icon is displayed in the status bar and notification center.

* On Samsung Galaxy Android smartphones, the app icon is displayed.
* On standard Android smartphones or simulators, a white circle icon is displayed.
* If you have used the push message icon change feature, the changed icon is displayed.
  {% endstep %}
  {% endstepper %}

## Deep Link Navigation

Hackle push messages support deep link navigation on click.

For information on how to use React Native deep links in an Android environment, refer to the [React Native Deep Link Guide](https://reactnative.dev/docs/linking?syntax=android).

{% hint style="warning" %}
When connected to a remote JS debugger, React Native's `Linking.getInitialURL()` returns `null`, causing a [known issue](https://reactnative.dev/docs/linking?syntax=android\&language=typescript\&ios-language=swift#getinitialurl) where the deep link URL cannot be retrieved.
{% endhint %}

## Push Message Icon Change

{% hint style="info" %}
This feature is supported in React Native SDK version 3.25.0 and above.
{% endhint %}

{% hint style="warning" %}
Due to Google policy, icons that include color cannot be set as push icons on standard Android smartphones.
{% endhint %}

Hackle push messages support push icon customization. You can change the push icon using local app resources by assigning resources to pre-defined keys in `AndroidManifest.xml`.

{% hint style="info" %}
For details on small\_icon, large\_icon, and color, refer to the [Android Push Design Guide](https://developer.android.com/design/ui/mobile/guides/home-screen/notifications?hl=ko#notification-header).
{% endhint %}

<table><thead><tr><th width="400">key</th><th>Description</th></tr></thead><tbody><tr><td><code>io_hackle_android_default_notification_small_icon</code></td><td>Sets the small icon.</td></tr><tr><td><code>io_hackle_android_default_notification_large_icon</code></td><td>Sets the large icon.</td></tr><tr><td><code>io_hackle_android_default_notification_color</code></td><td>Sets the small icon background color.</td></tr></tbody></table>

#### Example

```xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <application
        android:name=".MainApplication"
        >
       ...
       <meta-data
            android:name="io_hackle_android_default_notification_small_icon"
            android:resource="@drawable/ic_push_small"/>

       <meta-data
            android:name="io_hackle_android_default_notification_large_icon"
            android:resource="@drawable/ic_push_large"/>

       <meta-data
            android:name="io_hackle_android_default_notification_color"
            android:resource="@color/pie" />
       ...
    </application>
</manifest>
```

### Changing the Push Message Icon from the Dashboard

When a push icon is configured in the Dashboard, it modifies the large icon of the push message.

* If a push icon is set via local resources and a push icon is also sent from the Dashboard, the icon configured in the Dashboard takes precedence.

## Push Channel Support

{% hint style="info" %}
This feature is supported in React Native SDK version 3.26.0 and above.
{% endhint %}

With Hackle push messages, you can receive pushes through a channel pre-declared in your app. If a push is received with a channel ID that does not exist in the app, it falls back to the default channel provided by Hackle.

{% hint style="info" %}
For detailed information on adding push channels to your app, refer to the [Android Developer Documentation](https://developer.android.com/develop/ui/views/notifications/channels?hl=ko).

If you want to display a notification popup when a push is received, as on iOS, set the channel importance to `IMPORTANCE_HIGH`.
{% endhint %}

#### Example

The following is an example of creating a channel in the `onCreate` function of the Application class.

```kotlin
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.os.Build
import androidx.annotation.RequiresApi


override fun onCreate() {
    ... // 기존 구현
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        createNotificationChannel(applicationContext, "importance", "importance", NotificationManager.IMPORTANCE_HIGH)
    }
}


@RequiresApi(Build.VERSION_CODES.O)
private fun createNotificationChannel(context: Context, channelId: String, channelName: String, importance: Int) {
    val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
    if (notificationManager.getNotificationChannel(channelId) != null) {
        return
    }

    val channel = NotificationChannel(
        channelId,
        channelName,
        importance
    )
    notificationManager.createNotificationChannel(channel)
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hackle.io/en/development-guide/react-native/push-message/rn-android-push-message.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
