Integrate Growth Action [iOS]
Follow
Getting started
DFINERY Growth Action provides functions to help customers engage with their engagement marketing activities.
[Learn about Growth Action services]
Using the functions provided by DFINERY, you can create audience groups and conduct personalized marketing targeting each audience.
[[Quote:Guide:Normal]] To use Growth Action, you must use the DFINERY paid plan.[ Contact Us ]
Push service preferences
Certificate Registration
Register a certificate to use the iOS Gross Action service.
Register in Definary Console / Growth Action / Settings / iOS Push Setting.
[[Quote:Warning:Normal]]
Please check.
- You must register a p12 certificate without a password.
- p12 certificate must be registered as Production type.
- iOS Gross Action Server Push only works in Production environments.
- iOS Gross Action Server Push only works in Production environments.
Add Capability
Complete the following to integrate with iOS Gross Action Service.
- Add Background Modes and Push Notifications to the app's Signing & Capabilities -> Capability
- In Background Modes, check Remote notifications
Add framework
To use the iOS Gross Action service, please complete the following:
- In the General section, add NotificationCenter.framework and UserNotifications.framework.
Add Notification Service Extension
Add Notification Service Extension for using GrossActions on iOS.
a. Click the '+' button at the bottom of Xcode
b. Select Notification Service Extension and click the Next button.
c. Enter Product Name and complete
d. Add AdBrixRmKit.xcframework to the General settings of the Extension.
The framework is currently located in the Pods -> AdBrixRmKit folder of your project.
e. Once the Extension settings are complete, open the NotificationService file that was automatically added to the folder and modify it as follows.
//NotificationService.swift import UserNotifications import AdBrixRmKit class NotificationService : AdBrixPushService {}
//NotificationService.h #import #import @interface NotificationService : AdBrixPushServiceObjC @end //NotificationService.m #import "NotificationService.h" @implementation NotificationService
@end
Token value setting
To use the iOS gross action service, add and modify the following contents to AppDelegate.
a. Get Device Token value
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data){ //This is an example of checking the registered push token value. let token = deviceToken.map {String(format: "%02.2hhx", $0)}.joined()
print(token)
//Connect the push token as follows: let adBrix = AdBrixRM.getInstance adBrix.setRegistrationId(deviceToken: deviceToken) }
/- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
//This is an example of checking the registered push token value. const unsigned char *data = (const unsigned char *)[deviceToken bytes];
NSMutableString *token = [NSMutableString string];
for (NSUInteger i = 0; i < [deviceToken length]; i++) {
[token appendFormat:@"%02.hhX", data[i]];
}
NSLog(@"%@", token);
//Connect the push token as follows: AdBrixRM * adBrix = [AdBrixRM sharedInstance];
[adBrix setRegistrationIdWithDeviceToken:deviceToken]; }
Push reception settings
a. Added push On / Off function based on user notification permission consent in didFinishLaunchingWithOptions
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate { ...
func application ( _ application: UIApplication , didFinishLaunchingWithOptions launchOptions: [ UIApplication . LaunchOptionsKey : Any ]?) -> Bool {
application.registerForRemoteNotifications()
let unCenter = UNUserNotificationCenter.current() unCenter.delegate = self let options : UNAuthorizationOptions = [.alert,.sound,.badge] unCenter.requestAuthorization(options: options, completionHandler: {(granted,error) in if granted {
DispatchQueue.main.async {
// If Push permission is granted enable AdBrix Push AdBrixRM.getInstance.setPushEnable(toPushEnable: true) application.registerForRemoteNotifications() } } else {
// If Push permission is not granted disable AdBrix Push AdBrixRM.getInstance.setPushEnable(toPushEnable: false)
} }) ... }
//AppDelegate.h #import #import @interface AppDelegate : UIResponder @end //AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
... [application registerForRemoteNotifications ]; UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self; [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error){ if(granted) {
[[UIApplication sharedApplication] registerForRemoteNotifications]; AdBrixRM * adBrix = [AdBrixRM sharedInstance]; [adBrix setPushEnableToPushEnable:true];
} else {
AdBrixRM * adBrix = [AdBrixRM sharedInstance]; [adBrix setPushEnableToPushEnable:false];
} }]; ... }
[[Quote:Warning:Normal]]
Check default settings
The default setting for Definery is 'Push off'.
Therefore, after completing the gross action integration, you must get the users' consent to receive push notifications and then call the setPushEnable(toPushEnable: Bool) API. Please call by passing true as the toPushEnable: Bool value.
Users who have previously agreed to receive push notifications must also call the setPushEnable() API to receive push notifications.
b. Set foreground notifications
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { if let apsInfo = notification.request.content.userInfo["aps"] as? [String : Any] { if let genWhileRun = apsInfo["gen_while_run"] as? Bool, genWhileRun == true { completionHandler([.alert, .sound]) } } completionHandler([]) }
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler { NSDictionary *apsInfo = notification.request.content.userInfo[@"aps"]; if (apsInfo != nil) { NSNumber *genWhileRun = apsInfo[@"gen_while_run"]; if (genWhileRun.intValue == 1) { completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionSound); return; } } completionHandler(UNNotificationPresentationOptionNone); }
c. Add push click tracking function
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { AdBrixRM.getInstance.userNotificationCenter(center: center, response: response) completionHandler() }
- (void) userNotificationCenter:(UNUserNotificationCenter )center didReceiveNotificationResponse:(UNNotificationResponse )response withCompletionHandler:(void (^)(void))completionHandler{ AdBrixRM * adBrix =[AdBrixRM sharedInstance]; [adBrix userNotificationCenterWithCenter:center response:response]; completionHandler(); }
Notification subscription and opt-out settings
In order to integrate the DFINERY Growth Action feature, you need to set up a subscription for notifications.The SDK allows subscription and rejection settings for channels other than push, and also provides a function to retrieve the currently set value.
Subscribe to and opt out of notifications
Set the users notification consent value with the DFINERY server.
-
Related API Information
- SubscriptionStatus.Builder
-
Set SubscriptionStatus via SubscriptionStatus.Builder().build().
- setInformativeNotificationFlag(): Set consent to receive informative notifications
- setMarketingNotificationFlag(): Set consent to receive advertising notifications
- setMarketingNotificationFlagForPushChannel() : Advertising notification (push channel)
- setMarketingNotificationFlagForSmsChannel() : Marketing Notification (SMS Channel)
- setMarketingNotificationFlagForKakaoChannel(): Advertising notification (Notification Talk channel)
- setMarketingNotificationAtNightFlag(): Set consent to receive nighttime advertising notifications
- setMarketingNotificationAtNightFlagForPushChannel() : Nighttime marketing notification (push channel)
- setMarketingNotificationAtNightFlagForSmsChannel() : Nighttime marketing notification (SMS channel)
- setMarketingNotificationAtNightFlagForKakaoChannel(): Nighttime advertising notification (Notification Talk channel)
-
SubscriptionStatus._Type
- SUBSCRIBED : Agree
- UNSUBSCRIBED : rejected
- UNDEFINED: Default value that has not been set (this value is not reflected even if set as a type for the get API.)
-
SetSubscriptionResult
- isSuccess: Bool - Whether server communication was successful
- resultCode: Int? - Result code sent from the server
- resultMessage: String? - The result message sent from the server.
- AdBrixRM.setSubscription(status: SubscriptionStatus, completion: @escaping (SetSubscriptionResult) -> ())
[[Quote:Warning:Normal]]
Check default settings
If you use the API without calling the login(userId:) API, only informational notifications will be available and the audience will be classified as device-based. To use the user-based audience and advertising notifications, the login(userId:) call must be made first.
- Sample Code
//You only need to set the flags you need. Any values you do not set will be set to .UNDEFINED and sent to the server. let status = SubscriptionStatus.Builder()
.setInformativeNotificationFlag(to: .SUBSCRIBED)
.setMarketingNotificationFlag(to: .UNSUBSCRIBED)
.setMarketingNotificationFlagForKakaoChannel(to: .UNSUBSCRIBED)
.setMarketingNotificationFlagForSmsChannel(to: .SUBSCRIBED)
.setMarketingNotificationFlagForPushChannel(to: .UNSUBSCRIBED)
.setMarketingNotificationAtNightFlag(to: .UNSUBSCRIBED)
.setMarketingNotificationAtNightFlagForSmsChannel(to: .UNSUBSCRIBED)
.setMarketingNotificationAtNightFlagForKakaoChannel(to: .UNSUBSCRIBED)
.setMarketingNotificationAtNightFlagForPushChannel(to: .UNSUBSCRIBED)
.build()
AdBrixRM.getInstance.setSubscriptionStatus(status: status) { result in
if result.isSuccess {
print("success")
} else {
print(result.resultMessage)
print(result.resultCode)
}
}
AdBrixRM *adBrix = [AdBrixRM sharedInstance];
SubscriptionStatusBuilder *builder = [ SubscriptionStatus Builder ];
[[[builder setInformativeNotificationFlagTo : _TypeSUBSCRIBED ]
setMarketingNotificationFlagTo: _TypeSUBSCRIBED]
setMarketingNotificationFlagForPushChannelTo:_TypeSUBSCRIBED]
setMarketingNotificationAtNightFlagTo:_TypeUNSUBSCRIBED];
SubscriptionStatus *status = [builder build];
[adBrix setSubscriptionStatusWithStatus:status completion:^( SetSubscriptionResult *result) {
if (result. isSuccess ) {
NSLog ( @"success" );
} else {
NSLog (result.resultMessage);
NSLog (result.resultCode);
}
}];
[[Quote:Danger:Moderate]]
Caution
If the flag is not set,
it will be managed by the server in the default
UNDEFINED
state. In this case, to prevent pushes from not being sent due to unset flags, the server will
process the push
as SUBSCRIBED. Therefore, if you do not want to send pushes, please explicitly set the flag to UNSUBSCRIBED.
[[Quote:Danger:Moderate]]
Caution
Whether or not you consent to receive informational notifications is treated as
a higher concept
than whether or not you consent to receive advertising notifications. Therefore, if the informational flag is UNSUBSCRIBED, push notifications will not be sent even if the advertising flag is SUBSCRIBED.
Get notification subscription information
The currently set notification subscription information is retrieved from the DFINERY server.
-
Related API Information
-
SubscriptionStatus
- informativeNotificationFlag: Consent value for receiving informative notifications
- marketingNotificationFlag: Consent value for receiving advertising notifications
- marketingNotificationFlagForPushChannel: Consent to receive advertising notifications (push channel)
- marketingNotificationFlagForSmsChannel: Consent to receive advertising notifications (SMS channel)
- marketingNotificationFlagForKakaoChannel: Consent to receive advertising notifications (Notification Talk channel)
- marketingNotificationAtNightFlag: Consent value for receiving night-time advertising notifications
- marketingNotificationAtNightFlagForPushChannel: Consent to receive night-time advertising notifications (push channel)
- marketingNotificationAtNightFlagForSmsChannel: Consent to receive night-time advertising notifications (SMS channel)
- marketingNotificationAtNightFlagForKakaoChannel: Consent to receive nighttime advertising notifications (NotificationTalk channel)
-
SubscriptionStatus._Type
- SUBSCRIBED : Agree
- UNSUBSCRIBED : rejected
- UNDEFINED: Default value not set
-
GetSubscriptionResult
- isSuccess: Bool - Whether server communication was successful
- value: SubscriptionStatus? - If server communication is successful, the object with the above subscription consent value set
- resultCode: Int? - Result code sent from the server
- resultMessage: String? - The result message sent from the server.
- getSubscriptionStatus(completion: @escaping (GetSubscriptionResult) -> ())
-
SubscriptionStatus
- Sample Code
[[Quote:Risk:Moderate]]
Caution
Both getSubscriptionStatus and setSubscriptionStatus APIs work correctly only when the userId is stored on the server via the AdBrixRM.login API.
Additionally, you must turn push settings ON via the setPushEnable(toPushEnable: Bool) API before setting subscription.
[[Quote:Guide:Normal]]
Congratulations!!!
The basic integration for the Definary Growth Action service has been completed.
Server push service is now available. Please refer to the information below to set KakaoTalk push and SMS push message options.
Additional push service settings
KakaoTalk settings
This is the setting for using Kakao Notification Talk and Friend Talk. * KAKAOID: 10-digit Kakao ID received through Kakao Sync API
AdBrixRm.getInstance.setKakaoId(kakaoId: "KAKAOID") { result in if result.isSuccess { print("success")
//If the format of kakaoId is incorrect, isSuccess will be false. } else { print(result.resultCode)
print(result.resultMessage) } }
[[AdBrixRM sharedInstance] setKakaoIdWithKakaoId:@"kakaoId"
completion:^(SetCiProfileResult * result) { if (result.isSuccess) { NSLog(@"success");
//If the format of kakaoId is incorrect, isSuccess will be false. } else { NSLog(@"%@", result.resultCode);
NSLog(@"%@", result.resultMessage); } }];
[[Quote:Danger:Small]] This API is available after logging in.
SMS settings
Settings for SMS use. *PHONE_NUMBER: Country code + number excluding "+" in compliance with E.164 (Example: 8210********)
AdBrixRm.getInstance.setPhoneNumber(number: "PHONE_NUMBER") { result in if result.isSuccess { print("success")
//If the number format is incorrect, isSuccess will be false. } else { print(result.resultCode)
print(result.resultMessage) } }
[[AdBrixRM sharedInstance] setPhoneNumberWithNumber:@"PHONE_NUMBER"
completion:^(SetCiProfileResult * result) { if (result.isSuccess) { NSLog(@"success");
//If the number format is incorrect, isSuccess will be false. } else { NSLog(@"%@", result.resultCode);
NSLog(@"%@", result.resultMessage); } }];
[[Quote:Warning:Small]] PHONE_NUMBER: Country code that complies with E.164 + value excluding “+” from the number (Example: 8210********)
[[Quote:Danger:Small]] This API is available after logging in.
push notification delegate
Sets up delegates for local and server pushes.
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, AdBrixRmPushLocalDelegate, AdBrixRmPushRemoteDelegate { ... func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { ... // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // SDK init must call first adBrix.initAdBrix(appKey: "your_app_key", secretKey: "your_secret_key") adBrix.setAdBrixRmPushLocalDelegate(delegate: self) // Local Push Delegate adBrix.setAdBrixRmPushRemoteDelegate(delegate: self) // Reomte Push Delegate ... } // Local Push Delegate func pushLocalCallback(data: Dictionary?, state: UIApplication.State) { print("Local Push Received") } // Reomte Push Delegate func pushRemoteCallback(data: Dictionary?, state: UIApplication.State) { print("Remote Push Received") } ... }
//AppDelegate.h #import #import #import @interface AppDelegate : UIResponder @end //AppDelegate.m - (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { ... // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // SDK init must call first [adBrix initAdBrixWithAppKey:@"your_app_key" secretKey:@"your_secret_key"]; [adBrix setAdBrixRmPushLocalDelegateWithDelegate:self]; // Local Push Delegate [adBrix setAdBrixRmPushRemoteDelegateWithDelegate:self]; // Reomte Push Delegate ... } // Local Push Delegate - (void)pushLocalCallbackWithData:(NSDictionary _Nullable)data state:(UIApplicationState)state { printf(“Local push Received”); } // Reomte Push Delegate - (void)pushRemoteCallbackWithData:(NSDictionary _Nullable)data state:(UIApplicationState)state { printf(“Remote push Received”); }
[[Quote:Risk:Medium]] Each delegate is triggered when the app comes to the foreground by clicking the push.
[[Quote:Risk:Moderate]]
Caution
In the case of the server push delegate (pushRemoteCallback), if you select simple AppOpen when setting up push, no value is passed. Therefore, please handle this exception.
[[Quote:Danger:Moderate]]
Caution
Each push delegate must be called after SDK init.
Local push settings
Local push call
Implement local push, called directly from the client.
@IBAction func localPushEvent(_ sender: Any) { let calendar = Calendar.current let alarmTime = calendar.date(byAdding: .second, value: 5, to: Date()) let notisound = UNNotificationSound(named: UNNotificationSoundName(rawValue: "mySound.aiff")) AdBrixRM.getInstance.registerLocalPushNotification(id: "12345", date: alarmTime!, title: "this is Title", subtitle: "this is subtitle", body: "This is text", sound: notisound, categoryId: nil, threadId: nil, badgeNumber: 3, image:URL(string: "https://myURL.com/myImage.jpg"), attrDic: ["customKey" : "customValue"], completionHandler: {(isRegSucc,error,pushid)in print("registerLocalPushnotification is RegSucc:: \(isRegSucc) : \(pushid)") }) }
- (IBAction)localPush:(id)sender { NSCalendar *calendar = [NSCalendar currentCalendar]; NSDate *alarmTime = [calendar dateByAddingUnit:NSCalendarUnitSecond value:5 toDate:[NSDate date] options:0]; UNNotificationSound *notisound = [UNNotificationSound soundNamed:@"mySound.aiff"]; NSDictionary *myAttrDic = [NSDictionary dictionaryWithObjectsAndKeys:@"cutomValue1",@"customKey1", nil]; NSURL *myImage = [NSURL URLWithString:@"https://myURL.com/myImage.jpg"]; NSNumber *badgeNumber = [NSNumber numberWithInt:3]; AdBrixRM * adBrix =[AdBrixRM sharedInstance]; [adBrix registerLocalPushNotificationWithId:@"12345" date:alarmTime title:@"this is Title" subtitle:@"this is subtitle" body:@"this is Text" sound:notisound categoryId:nil threadId:nil badgeNumber:badgeNumber image:myImage attrDic:myAttrDic completionHandler: ^(BOOL response, NSError *_Nullable error, NSString *pushId) { printf("registerLocalPushnotification :: \(response) : \(pushID)"); }]; }
Property Value
- id: unique ID for push registration
- date : push notification date
- title : Title (top)
- subtitle : secondary title (below the title)
- body : Main text
- sound : Push notification sound (if nil, default sound is used)
- categoryId : Category ID
- threadId : thread ID
- badgeNumber: Badge number displayed on the app icon
- image: Server or local image to use for push (if it is a server image, be sure to use https://)
- attrDic: Dictionary data to be used separately
-
completionHandler: Push registration callback listener
- isRegSucc: Whether push registration is complete
- error: Error content when push registration fails (data is nil when successful)
- pushId: Registered push ID
local push control
Used to manage and control the currently configured local pushes.
//Current Local Push List AdBrixRM.getInstance.getRegisteredLocalPushNotification(completeHandler: {(idArr) in print(“myLocalPushList : \(idArr)“) }) // Cancel the certain Local Push let arr : Array = ["pushid1"] AdBrixRM.getInstance.cancelLocalPushNotification(ids: arr) // Cancel all Local Push AdBrixRM.getInstance.cancelLocalPushNotificationAll()
>AdBrixRM * adBrix =[AdBrixRM sharedInstance]; //Current Local Push List [adBrix getRegisteredLocalPushNotificationWithCompleteHandler:^(NSArray *idArr){ printf(“myLocalPushList :: \(idArr)“); }]; //Cancel the certain Local Push NSArray *arr = [NSArray arrayWithObjects : @“pushid1”,nil]; [adBrix cancelLocalPushNotificationWithIds:arr]; //Cancel all Local Push [adBrix cancelLocalPushNotificationAll];
- getRegisteredLocalPushNotification: Calls the currently scheduled local push list
- cancelLocalPushNotification: Cancel a local push call with a specific push ID.
- cancelLocalPushNotificationAll : Cancel all local push calls.
In-app messaging service settings
Basic setting
DFINERY in-app messages do not require separate integration.
[[Quote:Warning:Normal]] Your app must have a UIScene attached to it and in the forgroundActive state.
In-app messages can be exposed by triggering events delivered through the DFINERY SDK, and all settings can be made in the DFINERY console.
[[Quote:Information:General]] The in-app messaging feature can be used in DFINERY iOS SDK version 2.0.0.1 or higher.
Click event delegate settings
The users in-app message click event is delivered through the configured event delegate.
You can use this delegate to define additional actions for click events.
@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, AdBrixRMInAppMessageClickDelegate{ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { let adBrix = AdBrixRM.getInstance // Add InAppMessage Click Delegate adBrix.setInAppMessageClickDelegate(delegate: self) return true } func onReceiveInAppMessageClick(actionId : String, actionType : String, actionArg : String, isClosed : Bool) { NSLog("inAppMessageDelegate actionId : \(actionId)") NSLog("inAppMessageDelegate actionType : \(actionType)") NSLog("inAppMessageDelegate actionArg : \(actionArg)") NSLog("inAppMessageDelegate isClosed : \(isClosed)") } }
>//AppDelegate.h #import #import #import @interface AppDelegate : UIResponder @end //AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { AdBrixRM * adBrix = [AdBrixRM sharedInstance]; // Add InAppMessage ClickDelegate [adBrix setInAppMessageClickDelegateWithDelegate:self]; } - (void)onReceiveInAppMessageClickWithActionId:(NSString *)actionId actionType:(NSString *)actionType actionArg:(NSString *)actionArg isClosed:(BOOL)isClosed { NSString *logMessageActionId =@"inAppMessageDelegate actionId :"; logMessageActionId = [logMessageActionId stringByAppendingString: actionId]; NSLog(@"%@", logMessageActionId); NSString *logMessageActionType =@"inAppMessageDelegate actionType :"; logMessageActionType = [logMessageActionType stringByAppendingString: actionType]; NSLog(@"%@", logMessageActionType); NSString *logMessageActionArg =@"inAppMessageDelegate actionArg :"; logMessageActionArg = [logMessageActionArg stringByAppendingString: actionArg]; NSLog(@"%@", logMessageActionArg); NSString *logMessageIsClosed =@"inAppMessageDelegate isClosed :"; NSString *isClosedString = @"FALSE"; if(isClosed) { isClosedString = @"TRUE"; } logMessageIsClosed = [logMessageIsClosed stringByAppendingString: isClosedString]; NSLog(@"%@", logMessageIsClosed); }
Click event delegate delivery value details
Types and examples of values passed through delegates are as follows.
- actionId (String): button_1, button_2, image, sticky
- actionType (String): close, deeplink_and_close, weblink, weblink_and_close, dont_show_me_today_and_close
- actionArg (String): weblink address, deeplink path
- isClosed (Boolean): Whether the in-app message was closed.
Using Self-Serve In-App Messages
What is Self-Serve In-App Message?
Self-Serve in-app messages refer to in-app messages that the user directly retrieves and opens data, unlike in-app messages that are triggered by events occurring in the SDK.
guide
-
getSelfServeInAppMessages(completion: @escaping ([SelfServeInAppMessage]) ->())
- Get self-serve in-app messages.
-
openInAppMessage(campaignId: String, completion: @escaping (Completion) -> ())
- Displays an in-app message corresponding to campaignId.
-
SelfServeInAppMessage
- campaignId: String. Campaign id.
- extAttr: [String: Any?]. Additional settings value set in the console.
Example of use
func openSelfServeInAppMessage() { let adbrix = AdBrixRM.getInstance adbrix.getSelfServeInAppMessages { selfServeInAppMessages in for message in selfServeInAppMessages { if message.extAttr["key"] as! String == "value" { adbrix.openInAppMessage(campaignId: message.campaignId) { openResult in switch openResult { case .success: print("success") case .fail: print("fail") } } } } } }
-(void)openSelfServeInAppMessage { AdBrixRM *adbrix = [AdBrixRM getInstance]; [adbrix getSelfServeInAppMessages:^(NSArray *selfServeInAppMessages) { for (NSDictionary *message in selfServeInAppMessages) { if ([[message[@"extAttr"] objectForKey:@"key"] isEqualToString:@"value"]) { [adbrix openInAppMessageWithCampaignId:message[@"campaignId"] completion:^(OpenResult openResult) { switch (openResult) { case OpenResultSuccess: NSLog(@"success"); break; case OpenResultFail: NSLog(@"fail"); break; } }]; } } }]; }