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

Push Message Integration

1

Integrate Firebase Project

To use Push Messages in an Android app, you need to configure the integration between the Hackle Workspace and a Firebase project.

Android FCM Integration
2

Integrate Firebase Cloud Messaging SDK

Complete the Android app setup by following the Firebase Cloud Messaging Installation Guide.

3

Integrate with Hackle SDK

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

The push token is automatically registered when the app is built and launched.

Once the SDK integration is complete, push token collection, push reception, and push click handling are automatically enabled.

4

Test Push Messages

Check Token

Test Send

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 customized the push icon, the changed icon is displayed.

Hackle Push Messages support deep link navigation on click. When the activity is opened via a Push Message, you can retrieve the opened deep link information as follows.

For more details on Android deep links, see the Android Deep Link Guide.

import android.app.Activity
import android.content.Intent
import android.os.Bundle

class ExampleActivity : Activity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstance)
        if (intent != null && !intent.dataString.isNullOrEmpty()) {
            //  Do something ...
            println("link : ${intent?.dataString}")
        }
    }

    override fun onNewIntent(intent: Intent?) {
        super.onNewIntent(intent)
        setIntent(intent)
        if (intent != null && !intent.dataString.isNullOrEmpty()) {
            //  Do something ...
            println("link : ${intent?.dataString}")
        }
    }
}

Change Push Message Icon

This feature is supported in Android SDK 2.57.0 and above.

Hackle Push Messages support changing the push icon. By assigning a resource to the pre-defined keys in AndroidManifest.xml, you can change the push icon using local app resources.

For more details on small_icon, large_icon, and color, see 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

Modify Push Message Icon from the Dashboard

When a push icon is configured in the Dashboard, the large icon of the push is modified.

  • If a push icon is configured both as a local resource and in the Dashboard, the icon set in the Dashboard takes precedence.

Push Channel Support

This feature is supported in Android SDK 2.58.0 and above.

With Hackle Push Messages, you can receive pushes on a pre-declared channel in the app. If a push is received with a channel ID that does not exist in the app, it is received on the default channel provided by Hackle.

For how to add a push channel to your app, see the Android Developer Documentation.

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

Last updated