Action Buttons

Android SDK allows you to put clickable buttons under the notification.

Requirements

  • Android SDK 2.0.0+

Before you start, if you need to handle action buttons yourself, then you need to set your receiver in androidmanifest.xml which extends from com.dengage.sdk.NotificationReceiver. Otherwise, the SDK will handle button clicks.

You need to define your receiver in your manifest file.

<receiver android:name=".MyReceiver"  
  android:exported="false">  <!-- change NotificationReceiver to .MyReceiver -->   
 <intent-filter> 
 ...
 <action android:name="com.dengage.push.intent.ACTION_CLICK" /> <!-- add this line-->   
 </intent-filter>
 </receiver>

The SDK fires an intent and to handle the intent you can use the following function in the launcher activity

PushDataParser.parseIntent(intent, pushMessageCallback = object : PushMessageCallback {
            override fun dataFetched(message: Message) {
            
            }

            override fun onActionClick(intent: Intent, message: Message, clickedId: String) {
               
            }


        })