Push Message Integration
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 IntegrationIntegrate Firebase Cloud Messaging SDK
Complete the Android app setup by following the Firebase Cloud Messaging Installation Guide.
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.
Test Push Messages
Check Token
Use the User Identifier guide to check the token configured on the Android device.
Use the User Profile guide to check the Android push token assigned to a specific user.
Test Send
Follow the Push Message test send guide to verify Push Messages on an Android device.
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.
Deep Link Navigation
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.
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
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.
Due to Google policy, icons with color cannot be set as push icons on standard Android smartphones.
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
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.
Last updated