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

2min

CTA Configuration

Cooee SDK supports callback on any action of in-app notifications actions by returning a map of key-value pairs (i.e. objects in JavaScript). You can check more CTA options on Call to Action page.

To handle callbacks, modify your global code i.e. app.component.ts

JS
|
import {Component, OnInit} from '@angular/core';
import {CooeeService} from './services/cooee.service';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit {

    constructor(private readonly cooeeService: CooeeService) {
        this.cooeeService.init();
    }

    ngOnInit(): void {
        // Add this
        this.cooeeService.onCTA()
            .subscribe((payload: Record<string, any>) => {
                if (!payload) return;

                if (payload.actionType === 'VIEW_ITEM') {
                    // Take the user to the given item's page. Item id will be in "payload.id"
                } else if (payload.actionType == 'GO_TO_SCREEN') {
                    // Take user to the given screen name
                }
            });
    }

}





Updated 03 Mar 2023
Did this page help you?
Yes
No
PREVIOUS
Tracking Screens
NEXT
WooCommerce
Docs powered by archbee 
TABLE OF CONTENTS
CTA Configuration