Engage
Undocumented
-
Set the debug value as true to print all useful informations in console.
Declaration
Swift
public static var debug : Bool = false -
Initialize the engage SDK in the client application.
Declaration
Swift
public class func initialize(application : UIApplication , didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?, accountId : String, projectId : String)Parameters
applicationUIApplication Instance
clientIdENGAGE_CLIENT_ID
projectIdENGAGE_PROJECT_ID
-
Sets the user profile specific to current user
Setting the user profile details helps in targeting users specific to a gender, age group or country. This also enable to run user personalized campaigns across devices.
Declaration
Swift
public class func identify(traits : Traits)Parameters
traitsInstance of Traits class.
-
Logs app events to Engage. These events are used trigger campaigns, track app usage etc.
Declaration
Swift
public class func track(eventName : String, params : [NSObject : AnyObject])Parameters
eventNamename of the event
paramsParameters of the event.
-
Logs engage Default supported events to Engage. These events are used trigger campaigns, track app usage etc.
Declaration
Swift
public class func track(event : EngageEvent)Parameters
eventNamename of the event
paramsParameters of the event.
-
Enables or disables campaign dialogs in the app. Individual campaign dialogs may be handled separately by implementing registerForCampaignEvents.
Campaign dialogs are enabled by default
Declaration
Swift
public class func setCampaignDialogsEnabled(enabled : Bool)Parameters
enableduse true or false based on whether to show campaigns or not.
-
Enables or disables Developer Mode of EngageMent SDK.
ENABLE_CAPTURE_EVENTS is disabled by default
Declaration
Swift
public class func ENABLE_CAPTURE_EVENTS(enabled : Bool)Parameters
enabledset true or false to enable/disable ENABLE_CAPTURE_EVENTS is SDK.
-
Register to engageSDK PushNotification Campaign Pass deviceToken to engage SDK after registering for push notifications.
Declaration
Swift
public class func registerForRemoteNotificationsWithDeviceToken(deviceToken : NSData)Parameters
deviceTokendeviceToken recieved from func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData)
-
Inform Engage SDK When a notification is recieved.
Declaration
Swift
public class func onNotificationRecieved(userInfo : [NSObject:AnyObject]) -> NotificationData?Parameters
userInfouserInfo recieved from notification
Return Value
This function will return an Instance of NotificationData if the notification recieved was from engage, It will return a nil value if the notification is recieved from an unknown source.
-
Inform Engage SDK that the notification is Opened/Interacted by the user.
Declaration
Swift
public class func onNotificationOpened(userInfo : [NSObject:AnyObject]) -> NotificationData?Parameters
userInfouserInfo recieved from notification
Return Value
This function will return an Instance of NotificationData if the notification recieved was from engage, It will return a nil value if the notification is recieved from an unknown source.
-
Shutdown the engage SDK. All functionalities related to SDK wil be stopped immediately after calling this method. Eg. It will clear all the user traits informations,stop tracking events, stops campaigns etc. Inorder to start the SDK functionality again , client application must call identify(traits : Traits) method.
Declaration
Swift
public class func shutDown() -
User can register to campaign events. For more details regarding the events supported refer CampaignEventDelegate interface
Declaration
Swift
public class func registerForCampaignEvents(campaignEventDelegate : CampaignEventDelegate)Parameters
campaignEventDelegatean Object that implements CampaignEventDelegate protocol
Engage Class Reference