Action Buttons

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 with 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.

  1. <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 event callback which is called onActionClick in your receiver class when an action button is clicked. So you can catch the button.

  1. public class MyReceiver extends NotificationReceiver {  
        @Override  
      protected void onActionClick(Context contextIntent intent) {  
            Bundle extras = intent.getExtras();  
            if(extras != null)  
            {  
                 String actionId = extras.getString("id");  
                 int notificationId = extras.getInt("notificationId");  
                 String targetUrl = extras.getString("targetUrl");  
      
                 Log.d("DenPush"actionId +" is clicked");  
            }  
      
           // Remove if you prefer to handle targetUrl which is actually correspond a deeplink.  
           super.onActionClick(contextintent);  
      }  
    }

    • Related Articles

    • What are the nodes that can be used in a campaign?

      You may find each node below with their explanation: CHANNEL NODES: Email: This node is used to send email content to the target audience. This can be used only for contacts. SMS: This node is used to send SMS content to the target audience. This can ...
    • May 21, 2020

      Improvements to Mobile Push Notifications & Automated Data Jobs We’re happy to announce the arrival of mobile “Rich(er) Push Notifications”, starting with a Carousel layout for both Android and iOS platforms. Carousel push notifications enable you to ...
    • What's New

      Here's What's New in dEngage RECENT RELEASES June 05, 2020 New Features Available with this Release: Importing and Using Data from Amazon Redshift and Google Big Query Sending Push Notifications to Huawei Devices Using Reply-To Address in Email We're ...
    • Woocommerce Plugin for D·engage Integration

      D·engage is now able to integrate with the most go to platform for Ecommerce, i.e Woocommerce. Integrating with D·Engage via WP plugin is a couple of steps process that provides ease and flexibility to your tech team. Let me guide you here the steps ...
    • Campaign creation

      Campaign creation With Campaigns you are able to send communications to your clients. You can work with: - SMS - Emails - Web Push - Mobile Push - Onsite  - In App Which types of campaign can we create? Here at Dengage we have two types of campaigns: ...