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 in iOS

2min

CTA Configuration

Cooee SDK supports callback when users perform any action on in-app notifications & push notifications by returning a dictionary 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:

ObjectiveC
Swift
|
@interface ViewController () <CooeeCTADelegate>
@end

@implementation ViewController

- (void)onCTAResponseWithPayload:(NSDictionary<NSString *,id> * _Nonnull)payload
{
    if (payload.count == 0) {
        return;
    }
  
    if (payload[@"actionType"] isEqual: @"VIEW_ITEM") {
        // Use payload[@"item"]
    } else if (payload[@"actionType"] isEqual: @"GO_TO_SCREEN") {
        // Use payload[@"screenName"]
    }
}

@end


And then set the delegate instant to CooeeSDK

ObjectiveC
Swift
|
@implementation ViewController

- (void)viewDidLoad 
{
    [super viewDidLoad];
    
    CooeeSDK *cooeeSDK = [CooeeSDK getInstance];

    [cooeeSDK setOnCTADelegate:self];
}
@end




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