For the complete documentation index, see llms.txt. This page is also available as Markdown.

Android Push Message Integration

1

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.

2

Integrate Firebase Cloud Messaging SDK

Complete the Android app setup by referring to the Firebase SDK Integration Guide and the Firebase Cloud Messaging Installation Guide.

3

Integrate with the Hackle SDK

Refer to SDK Integration to add the Hackle SDK dependency and initialize the SDK.

The push token is automatically collected when the app launches.

Once the SDK integration is complete, push tokens are automatically collected, and push reception and push click handling become available.

4

Test Push Messages

Verify Token

Test Sending

5

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.

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.

Push Message Icon Change

This feature is supported in React Native SDK version 3.25.0 and above.

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.

For details on small_icon, large_icon, and color, refer to the Android Push Design Guide.

key
Description

io_hackle_android_default_notification_small_icon

Sets the small icon.

io_hackle_android_default_notification_large_icon

Sets the large icon.

io_hackle_android_default_notification_color

Sets the small icon background color.

Example

<?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

This feature is supported in React Native SDK version 3.26.0 and above.

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.

For detailed information on adding push channels to your app, refer to the Android Developer Documentation.

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

Example

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

Last updated