website logo
HomeGo to Dashboard
User Guide
How-To Videos
Developers
Navigate through spaces
⌘K
Getting Started
Introduction
Compatibility
Terminology
SDK Installation
Shopify
Any Website
Dukaan
Angular 2+
WooCommerce
WordPress
Android Native
iOS Native
Flutter
Cordova
Ionic
React Native
Data Integration
Data Models
Mandatory Events
Mandatory Properties
Call to Action
System Events
Device Properties
Docs powered by archbee 

CTA Callback for Android

3min

CTA Configuration

Cooee SDK supports callback when users perform any action on in-app notifications & push notifications by returning a map of key-value pairs. Check for more Call to Action according to your industry.

Implements the CooeeCTAListener somewhere in your global code (like Application class) and override the following method:

Java
Kotlin
|
public class HomeActivity extends AppCompatActivity implements CooeeCTAListener {
    @Override
    public void onResponse(HashMap<String, Object> payload) {
        if (payload == null) {
            return;
        }

        if (payload.get("actionType") == "VIEW_ITEM") {
            // Use payload.get("item")
        } else if (payload.get("actionType") == "GO_TO_SCREEN") {
            // Use payload.get("screenName")
        }
    }
}


And then set the interface instant to CooeeSDK

Java
Kotlin
|
@Override
protected void onCreate(Bundle savedInstanceState) {
    CooeeSDK cooeeSDK = CooeeSDK.getDefaultInstance(context);
    cooeeSDK.setCTAListener(this);
}


Handle Application Name

If your application is not using android.app.Application class to do anything, please remove the android:name in the application tag from the AndroidManifest.xml (if there).

Otherwise, if it is used/needed, use our com.letscooee.init.AppController class which already extends the android.app.Application class.

Updated 03 Mar 2023
Did this page help you?
Yes
No
PREVIOUS
Tracking Screens on Android
NEXT
iOS Native
Docs powered by archbee 
TABLE OF CONTENTS
CTA Configuration
Handle Application Name