Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Callbacks

Push message callbacks

WebEngage iOS SDK does not provide any custom APIs or callbacks for APNs callbacks. Your app can implement standard iOS App Delegate methods. All WebEngage push notifications will be delivered to the same callbacks for any custom processing.

See UIApplicationDelegate reference for more details.

Note that WebEngage iOS SDK does not require APIs to pass the device registration token (similar to WebEngage.get().setRegistrationID(registrationId) in Android) or APNs message (similar to WebEngage.get().receive(bundle) in Android). The iOS SDK handles those automatically by intercepting standard callbacks for the purpose.

In case you are using pod 'WebEngage', the callback to push notification clicks - application:didReceiveRemoteNotification:fetchCompletionHandler will not be called when a user taps on a remote notification on an iOS 10.0 (or later) device.

This is because WebEngage SDK uses the new UserNotifications framework introduced in iOS 10.0 for handling push notifications, which deprecates the method.
If your app needs to use the above method to detect push calls to action, refer to this link.

In-app message callbacks

In order to use In-app notification callbacks, your application must define a class which implements the WEGInAppNotificationProtocol and set it as the notification callback delegate in the initialization call to SDK with the appropriate API for the same.

@protocol WEGInAppNotificationProtocol <NSObject>
-(NSMutableDictionary*) notificationPrepared:(NSMutableDictionary*) inAppNotificationData 
                                  shouldStop:(BOOL*)stopRendering;

-(void) notificationShown:(NSMutableDictionary*) inAppNotificationData;

-(void) notification:(NSMutableDictionary*) inAppNotificationData 
   clickedWithAction:(NSString*) actionId;

-(void) notificationDismissed:(NSMutableDictionary*) inAppNotificationData;
@end

In-App Notification Prepared

This callback gets triggered before the notification is shown. Assigning the value of stopRendering to YES will not render the notification.

-(NSMutableDictionary*) notificationPrepared:(NSMutableDictionary*) inAppNotificationData 
                                  shouldStop:(BOOL*)stopRendering;

In-App Notification Shown

This callback gets triggered after the notification is shown.

-(void) notificationShown:(NSMutableDictionary*) inAppNotificationData;

In-App Notification Clicked

This callback gets triggered when the user clicks the call to action button on the notification. The ID of the button clicked is passed as the second parameter. You can look up the button IDs in the inAppNotificationData dictionary.

-(void) notification:(NSMutableDictionary*) inAppNotificationData 
   clickedWithAction:(NSString*) actionId;

In-App Notification Dismissed

This callback gets triggered when the user dismisses the notification.

-(void) notificationDismissed:(NSMutableDictionary*) inAppNotificationData;

Notification Callback Data (NSMutableDictionary* inAppNotificationData)

{
    "canClose": true,
    "layoutAttributes": {
        "posX": 0,
        "posY": 0,
        "TITLE_ALIGN": "CENTER",
        "image_url": "http://s3-ap-southeast-1.amazonaws.com/wk-test-static-files/76a9d10/a6b6e04d-43e9-4c09-b15f-8acffbcfcc1a.jpg",
        "TITLE_WRAP": false,
        "wvWidth": 100,
        "type": "BLOCKING",
        "wvHeight": 100,
        "fullScreen": false
    },
    "showTitle": true,
    "notificationEncId": "~13ssb59",
    "description": null,
    "canMinimize": true,
    "id": "173046a46",
    "isActive": true,
    "title": "My Title",
    "actions": [{
        "actionText": "Puma",
        "actionEId": "~64c71b",
        "actionTarget": "_top",
        "type": "DEEP_LINK",
        "actionLink": "webengage://com.webengage.inapptest/start_activity/com.webengage.inapptest.Activity1",
        "isPrime": true
    }],
    "config": {
        "titleColor": "#ffffff",
        "c2aBackgroundColor": "#411ad3",
        "c2aTextFont": "Open Sans",
        "titleFont": "Open Sans",
        "c2aTextColor": "#f7f2f2",
        "hideLogo": false
    },
    "direction": "ltr"
}

Callbacks