Adbrix Integration [iOS Objective-C]
FollowQuick Start
[[인용:위험:작게]] 18th Dec. 2020 Test with iOS Simulator not available
Currently, Adbrix SDK not working on iOS Simulator only on the ObjC project. We are working on dealing with this issue. So if you wish to run a test please use a real device.
System Requirement
Build Tool : Latest Xcode version required
Additional setup : Adbrix SDK written with latest version of Swift. So your project require use latest version Swift Library. (Current version of Swift : Swift 5)
SDK Installation and App setup
If you have an existing Xcode project follow these steps for SDK installation.
Ready for CocoaPods
CocoaPods is a tool for download and installs the external library.
We recommend using CocoaPods for installing SDK.
CocoaPods Installation
If you don't have CocoaPods on your Mac, Open the MacOS terminal and type this command.
$ sudo gem install cocoapods
After installation is complete, you can see these result on your terminal.
... Parsing documentation for cocoapods-1.5.0 Installing ri documentation for cocoapods-1.5.0 Done installing documentation for cocoapods-core, cocoapods-downloader, molinillo, nanaimo, xcodeproj, cocoapods after 9 seconds 6 gems installed
Initialize CocoaPods
After installing CocoaPods, initialize CocoaPods.
$ pod setup
After CocoaPods initialization is complete you can see these result on a terminal.
... Resolving deltas: 100% (518/518), completed with 177 local objects. From https://github.com/CocoaPods/Specs 8369a675212..ceea3be18e7 master -> origin/master $ /usr/bin/git -C /Users/username/.cocoapods/repos/master rev-parse --abbrev-ref HEAD master $ /usr/bin/git -C /Users/username/.cocoapods/repos/master reset --hard origin/master HEAD is now at ceea3be18e7 [Add] YTX_iOS_IM_SDK 0.0.7 Setup completed
Create Podfile
Go to your Xcode project folder and open the terminal type this command for generating Podfile.
$ pod init
Podfile setup
Open the vi editor on your terminal and type this commend on your Podfile.
After that press Esc, Shift+z twice for exit the editor.
$ vi Podfile
platform :ios, '8.0' target "myXcodeProject" do pod 'AdBrixRemastered' end
* platform number is minimum version of iOS for current Xcode project.
* There may be some error when you use a normal text editor.
Install SDK Pod
Type this command on the terminal for installing adbrix SDK.
$ pod install
* TroubleShooting!!! When pod install error occurs, execute command "pod setup".
Update SDK Pod
If you install adbrix SDK already, type command "pod update" or "pod setup" for installing latest adbrix SDK.
$ pod setup $ pod update
Open XCode Project
After installation of adbrix SDK completed, start {project_name}.xcworkspace file for open Xcode project. You can find adbrix pods.
$ open myXcodeProject.xcworkspace
Add required framework
To make adbrix SDK works, it requires to add iAD frameworks.
Move to [General > Linked Frameworks and Libraries] and click the (+) button and add "iAd.framework".
Swift Library Setup
adbrix SDK is using Swift language. So to use adbrix SDK, Xcode project is required to enable the Swift library.
Go to [Build Settings > Always Embed Swift Standard Libraries] and set 'yes' to use Swift library.
Apple IDFA Setup
To use adbrix Attribution SDK, Apple IDFA is required.
Please set IDFA at [AppDelegate.m > application: didFinishLaunchingWithOptions:]
#import "AppDelegate.h" #import <AdSupport/AdSupport.h> #import <AdBrixRM/AdBrixRM.h> @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; if ((NSClassFromString(@"ASIdentifierManager")) != nil) { NSUUID *ifa =[[ASIdentifierManager sharedManager]advertisingIdentifier]; [adBrix setAppleAdvertisingIdentifier:[ifa UUIDString]]; } return YES; }
AppKey & SecretKey setup
Set the adbrix AppKey and SecretKey issued from adbrix Homepage
#import <AdBrixRM/AdBrixRM.h> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // AdBrix AppKey / SecretKey setup [adBrix initAdBrixWithAppKey:@"odhvASVRDsdf10d019fva" secretKey:@"ar98LszQZUGdmSznToNBXg"]; return YES; }
* AppKey is different from adbrix Classic and adbrix Remastered.
* adbrix Remastered AppKey and SecretKey can be used on both Android and iOS platform.
Start from Sample Project
adbrix provides Xcode project which already have installed the adbrix SDK.
You can download the project base on your project language.
[adbrix Swift Sample Project link]
[adbrix Objective-C Sample Project link]
Additional SDK setup
After adbrix SDK setup is complete, you can add additional SDK set up
- Log level setup
- Event upload cycle setup
- GDPR setup
- Deeplink setup
Log Level Setup
Seup the log level for adbrix SDK log
There are 6 levels for adbrix SDK log.
- AdBrixLogLevelNONE : No SDK log can be shown on the terminal.
- AdBrixLogLevelTRACE : General SDK logs are shown on the terminal.
- AdBrixLogLevelDEBUG : Including TRACE, debug SDK logs are shown on the terminal.
- AdBrixLogLevelINFO : Including DEBUG, Saving, loading and uploading data logs are shown on the terminal
- AdBrixLogLevelWARNING : Including INFO, It shows the SDK error like Exception or non-fatal error.
- AdBrixLogLevelERROR : Including WARNING, It shows the every SDK logs including the fatal error.
#import <AdBrixRM/AdBrixRM.h> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // AdBrix Log Level setup [adBrix setLogLevel:AdBrixLogLevelERROR]; return YES; }
Event upload cycle setup
The developer can set Event upload cycle.
Event upload cycle can set base on how many events have been counted or base on time.
Event Upload counter
The developer can set Event upload counter that counts how many events have been called.
adbrix SDK has pre-defined API.
- AdBrixEventUploadCountIntervalMIN : If 10 events are counted SDK will upload your event.
- AdBrixEventUploadCountIntervalNORMAL : If 30 events are counted SDK will upload your event.
- AdBrixEventUploadCountIntervalMAX : If 60 events are counted SDK will upload your event.
#import <AdBrixRM/AdBrixRM.h> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Event Upload counter API [adBrix setEventUploadCountInterval:AdBrixEventUploadCountIntervalMIN]; return YES; }
Event upload timer
The developer can set the timer for uploading adbrix SDK event.
adbrix SDK has pre-defined API.
- AdBrixEventUploadTimeIntevalMIN : Every 30 seconds adbrix SDK will upload events.
- AdBrixEventUploadTimeIntevalNORMAL : Every 60 seconds adbrix SDK will upload events
- AdBrixEventUploadTimeIntevalMAX :Every 120 seconds adbrix SDK will upload events
#import <AdBrixRM/AdBrixRM.h> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Create AdBrixRM instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Event upload timer API [adBrix setEventUploadTimeInterval:AdBrixEventUploadTimeIntervalMAX]; return YES; }
GDPR Setup
The developer can stop the adbrix SDK with the GDPR API.
If GDPR API is called adbrix SDK will stop working including saving, uploading event.
This cannot be re-inversed unless the user deletes app.
- (IBAction)click_gdprForgetMe:(id)sender { // Creating AdBrixRM instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; [adBrix gdprForgetMe]; }
Deeplink and DefferdDeeplink
You can count app re-open event by deeplink url.
To do that, app must have custom url scheme.
Custom Url Scheme setup
Move to [General > Target > Info > URL Types] and set URL Scheme.
Deeplink open event.
Add deeplink open event API on AppDelegate.m application: openURL: delegate.
#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_9_0 - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Deeplink open API [adBrix deepLinkOpenWithUrl:url]; return YES; } #else - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { // Creating AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Deeplink open API [adBrix deepLinkOpenWithUrl:url]; return YES; } #endif
If you are using UIScene from iOS13 use this code at sceneDelegate.m.
#import <AdBrixRM/AdBrixRM-Swift.h> @interface SceneDelegate () @end @implementation SceneDelegate - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { // AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; if ((connectionOptions.URLContexts.allObjects.firstObject.URL) != nil) { NSURL *url = connectionOptions.URLContexts.allObjects.firstObject.URL; // Deeplink tracking api [adBrix deepLinkOpenWithUrl:url]; } } - (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *h> *)URLContexts { NSURL *url = URLContexts.allObjects.firstObject.URL; // AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Deeplink tracking api [adBrix deepLinkOpenWithUrl:url]; }
Deferred Deeplink Tracking
If you wish to send the user to a certain view when the user installs the app after click tracking link, Deferred Deeplink API can send the user to a certain view.
[[인용:위험:작게]] - Deferred Deeplink api will send scheme data with String after the user installs the app with tracking link.
example : yourscheme://your_custom_path
AppDelegate.h
#import <UIKit/UIKit.h> #import <AdBrixRM/AdBrixRM-Swift.h> @interface AppDelegate : UIResponder <UIApplicationDelegate, AdBrixRMDeferredDeeplinkDelegate> @property (strong, nonatomic) UIWindow *window; @end
AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Add Deeplink Delegate [adBrix setDeferredDeeplinkDelegateWithDelegate:self]; if ((NSClassFromString(@"ASIdentifierManager")) != nil) { NSUUID *ifa =[[ASIdentifierManager sharedManager]advertisingIdentifier]; [adBrix setAppleAdvertisingIdentifier:[ifa UUIDString]]; } return YES; } // Deferred Deeplink tracking - (void)didReceiveDeferredDeeplinkWithDeeplink:(NSString * _Nonnull)deeplink { NSLog(@"ADBRIXRM DEEPLINK RECEIVE : %@ ", deeplink); //Using "deeplink" value to send user to defined view }
SDK Initialization Example
If you add all 5 SDK initialization process AppDelegate.m will show like this
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { AdBrixRM *adBrix = [AdBrixRM sharedInstance]; //1) Apple IDFA if (NSClassFromString(@"ASIdentifierManager")){ NSUUID *ifa =[[ASIdentifierManager sharedManager]advertisingIdentifier]; [adBrix setAppleAdvertisingIdentifier:[ifa UUIDString]]; } //2) SDK Log leven [adBrix setLogLevel:AdBrixLogLevelTRACE]; //3) Event upload frequency : counter / timer [adBrix setEventUploadCountInterval:AdBrixEventUploadCountIntervalMIN]; [adBrix setEventUploadTimeInterval:AdBrixEventUploadTimeIntervalMAX]; //4) AppKey and SecretKey [adBrix initAdBrixWithAppKey:@"odhvASVRDsdf10d019fva" secretKey:@"ar98LszQZUGdmSznToNBXg"]; return YES; } #if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_9_0 - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { // Creating AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Deeplink Open API [adBrix deepLinkOpenWithUrl:url]; return YES; } #else - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { // Creating AdbrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Deeplink Open API [adBrix deepLinkOpenWithUrl:url]; return YES; } #endif
App Event Analysis
By using adbrix SDK, you can analyze the in-app events and create in-app event reports from adbrix dashboard.
To analyze the in-app event, you must add adbrix event API for the point where the event is executed.
The adbrix SDK provides five different types of in-app event APIs.
- User Analysis
- Login / Logout Event
- User information
- Location information
- Custom Analysis
- General Analysis
- Signup
- App update
- User invitation
- Use in-app credit
- In-Purchase
- Commerce Analysis
- Home view
- Category view
- Product view
- Add to cart
- Add to wishlist
- Review order
- Refund
- Product search
- Product share
- Product listview
- Cart view
- Payment information
- Game Analysis
- Tutorial complete
- Create character
- Stage complete
- Level up
User Analysis
Login / Logout Event
Analyze Login / Logout event
You can send UserID when user login succeeds.
- (void)loginAndLogoutEvent { // Create AdBrix Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; if(isSuccessLogin) { // Login success with userid user_1234 [adBrix loginWithUserId:@"user_1234"]; } }
* Warning: Do not send personal information like e-mail, phone number etc. on loginWithUserID API. If you have personal information on loginWithUserID API, We strongly recommend encrypting with BASE64, MD5, SHA1
User Infomation
You can analyze a user's age, gender and other information using adbrix SDK API.
- (void)userPropertyUpdate { // Create AdBrix instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Age NSInteger age = 30; [adBrix setAgeWithInt:age]; // Gender [adBrix setGenderWithAdBrixGenderType:AdBrixGenderTypeFemale]; // other information AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; [adBrix setUserPropertiesWithAttrWithAttrModel:attrModel]; }
[[인용:위험:보통]]Constraints of user and event data using AttrModel
1. You can send no more than 100 data.
2. The data type of Key is String and can use no more than 256 letters with Lowercase alphabetic characters and number only.
3. The Value data only be used no more then 1024byte.
Location information
If you can receive user location you can sen user location by adbrix SDK.
- (void)locationUpdate { // Create AdBrix Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; double lat = 37.541; double lon = 126.986; // Adbrix location API [adBrix setLocationWithLatitude:lat longitude:lon]; }
* adbrix do not take responsibility to use user location.
Custom event
adbrix SDK can analyze custom named event, which not pre-defined from adbrix SDK.
- (void)userCustomEvent { // Create AdBrix Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // addtional event info AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@“userid” :@“peterPark1234"]; [attrModel setAttrDataString:@“gender” :@“male”]; [attrModel setAttrDataInt:@“age” :36]; // Click a button "Invite a friend" [adBrix eventWithAttrWithEventName:@"invite_button_click" value:attrModel]; // Complete "Character creation" [adBrix eventWithAttrWithEventName:@"create_character_complete" value:attrModel]; // Complete "Tutorial view" [adBrix eventWithAttrWithEventName:@"tutorial_complete" value:attrModel]; // Achieve "Level 10" [adBrix eventWithAttrWithEventName:@"level_10" value:attrModel]; }
※ Warning
If you set up a custom event name as almost every situation like the following example, this will create tons of event.
// Create AdBrix Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; [adBrix eventWithEventName: @"custom:Lev-37 cleared,clearTime:00:00:39.2343535"];
So please use additional event parameter API(AdBrixRm.AttrModel) to manage the event.
// Create AdBrix Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // addtional event info AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataInt:@“level” :37]; [attrModel setAttrDataInt:@“clear_time_mile” :39238]; // custom event APi with event info [adBrix eventWithAttrWithEventName:@"level_clear" value:attrModel];
General Event Analysis
adbrix SDK can analyze general event like user registration, app update etc.
adbrix SDK provide 5 pri-define general event.
- Signup
- App update
- User invitation
- Using in-app credit
- In-app purchase
* If you wish to see in-app purchase report, you must integrate in-app purchase API.
Signup
You can analyze app registration event using adbrix SDK API.
- (void) registerEvent { // Creating AdBrix Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // User information AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Signup API [adBrix commonSignUpWithAttrWithChannel:AdBrixRmSignUpChannelAdBrixRmSignUpGoogleChannel commonAttr:attrModel]; }
App Update
You can analyze app update event using Adbrix SDK API.
- (void) appUdate { // Creating AdBrix instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // User information AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // App update API [adBrix commonAppUpdateWithAttrWithPrev_ver:@"1.0.2" curr_ver:@"1.0.4" commonAttr:attrModel]; }
User invitation
You can analyze the user invitation event using Adbrix SDK API.
- (void) userInvite { // Create AdBrix Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // User Information AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // User invitation API [adBrix commonInviteWithAttrWithChannel:AdBrixRmInviteChannelAdBrixRmInviteKakaoChannel commonAttr:attrModel]; }
Use in-app credit
You can analyze user using in-app credit event, using adbrix SDK API
- (void) useCredit { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // User Information AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Use in-appp credit API [adBrix commonUseCreditWithAttrWithCommonAttr:attrModel]; }
In-app purchase
You can analyze the in-app purchase event using adbrix SDK API
In-app purchase API require information that API already pre-defined.
- order id (required)
- product id (required)
- product name (required)
- price (required)
- quantity (required)
- discount (optional)
- currency (optional)
- category (optional)
- product attr map (optional)
- delivery charge (optional)
- payment method (optional)
- (void)purchaseEvent { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Create Event AttrMode AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel alloc]; [productAttr2 setAttrDataString:@"product_type" :@"pants"]; [productAttr2 setAttrDataString:@"color" :@"blue"]; [productAttr2 setAttrDataInt:@"size" :42]; [productAttr2 setAttrDataInt:@"cruurent_point" :23433]; [productAttr2 setAttrDataBool:@"promotion" :false]; // Product Model AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2" productName:@"productName2" price:23456.22 quantity:1 discount:2500.33 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"] productAttrsMap:productAttr2]; //productList Array NSMutableArray *productArray = [NSMutableArray array]; [productArray addObject:product1]; [productArray addObject:product2]; //In-app purchase API [adBrix commonPurchaseWithAttrWithOrderId:@"orderID1" productInfo:productArray discount:10000.00 deliveryCharge:2500.00 paymentMethod:[adBrix getPaymentMethod:AdbrixRmPaymentMethodCreditCard] orderAttr:attrModel]; }
Commerce Analysis
You can analyze in-app commerce event like product view, add to cart, etc using adbrix SDK API.
adbrix SDK provides 12 pre-defined commerce API
- Home view
- Category view
- Product view
- Add to cart
- Add to wishlist
- Review order
- Refund
- Product search
- Product share
- Product listview
- Cart view
- Payment information
Home view
You can analyze event which user views the main screen on your app, using adbrix SDK API.
- (void)viewHomeEvent { // Create Adbrix Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Home view API [adBrix commerceViewHome]; }
Category view
You can analyze event which user enters a certain product category using adbrix SDK API.
You can add a maximum of 5 categories on API
- (void)viewCategoryEvent { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Create Event AttrMode AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel alloc]; [productAttr2 setAttrDataString:@"product_type" :@"pants"]; [productAttr2 setAttrDataString:@"color" :@"blue"]; [productAttr2 setAttrDataInt:@"size" :42]; [productAttr2 setAttrDataInt:@"cruurent_point" :23433]; [productAttr2 setAttrDataBool:@"promotion" :false]; // Product Model AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2" productName:@"productName2" price:23456.22 quantity:1 discount:2500.33 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"] productAttrsMap:productAttr2]; //productList Array NSMutableArray *productArray = [NSMutableArray array]; [productArray addObject:product1]; [productArray addObject:product2]; //categoryView API [adBrix commerceCategoryViewWithAttrWithCategory:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"] productInfo:productArray orderAttr:attrModel]; }
Product view
You can analyze event which user enters a certain product using adbrix SDK API.
Product view API requires information that API already pre-defined.
- product id : (required)
- product name : (required)
- price : (required)
- quantity : (required)
- discount : (optional)
- currency string : (optional)
- category : (optional)
- product attr map : (optional)
- (void)viewProductDetailEvent { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; //ProductView API [adBrix commerceProductViewWithAttrWithProductInfo:product1 orderAttr:attrModel]; }
Add to cart
You can analyze event which user adds a certain product to cart using adbrix SDK API
Add to cart API require information that API already pre-defined.
- product id : (required)
- product name : (required)
- price : (required)
- quantity : (required)
- discount : (optional)
- currency string : (optional)
- category : (optional)
- product attr map : (optional)
- (void)addToCartEvent { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Create Event AttrMode AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel alloc]; [productAttr2 setAttrDataString:@"product_type" :@"pants"]; [productAttr2 setAttrDataString:@"color" :@"blue"]; [productAttr2 setAttrDataInt:@"size" :42]; [productAttr2 setAttrDataInt:@"cruurent_point" :23433]; [productAttr2 setAttrDataBool:@"promotion" :false]; // Product Model AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2" productName:@"productName2" price:23456.22 quantity:1 discount:2500.33 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"] productAttrsMap:productAttr2]; //productList Array NSMutableArray *productArray = [NSMutableArray array]; [productArray addObject:product1]; [productArray addObject:product2]; // add to cart api [adBrix commerceAddToCartWithAttrWithProductInfo:productArray orderAttr:attrModel]; }
Add to wishlist
You can analyze event which user adds a certain product to wishlist using adbrix SDK API
Add to wishlist API require information that API already pre-defined.
- product id : (required)
- product name : (required)
- price : (required)
- quantity : (required)
- discount : (optional)
- currency string : (optional)
- category : (optional)
- product attr map : (optional)
- (void)addToWishListEvent { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Add to wishlist api [adBrix commerceAddToWishListWithAttrWithProductInfo:product1 orderAttr:attrModel]; }
Review Order
You can analyze event which user reviews user's product order using adbrix SDK API.
Review Order API require information that API already pre-defined.
- order id : (required)
- product id : (required)
- product name : (required)
- price : (required)
- quantity : (required)
- discount : (optional)
- currency string : (optional)
- category : (optional)
- product attr map : (optional)
- delivery charge : (optional)
- (void)reviewOrderEvent { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Create Event AttrMode AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel alloc]; [productAttr2 setAttrDataString:@"product_type" :@"pants"]; [productAttr2 setAttrDataString:@"color" :@"blue"]; [productAttr2 setAttrDataInt:@"size" :42]; [productAttr2 setAttrDataInt:@"cruurent_point" :23433]; [productAttr2 setAttrDataBool:@"promotion" :false]; // Product Model AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2" productName:@"productName2" price:23456.22 quantity:1 discount:2500.33 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"] productAttrsMap:productAttr2]; //productList Array NSMutableArray *productArray = [NSMutableArray array]; [productArray addObject:product1]; [productArray addObject:product2]; // Review order api [adBrix commerceReviewOrderWithAttrWithOrderId:@"orderID_11" productInfo:productArray discount:5000.00 deliveryCharge:2500.00 orderAttr:attrModel]; }
Refund
You can analyze event which user cancel product order using adbrix SDK API.
Refund API require information that API already pre-defined.
- order id : (required)
- product id : (required)
- product name : (required)
- price : (required)
- quantity : (required)
- discount : (optional)
- currency string : (optional)
- category : (optional)
- product attr map : (optional)
- penalty charge : (optional)
- (void)refundOrderEvent { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Create Event AttrMode AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel alloc]; [productAttr2 setAttrDataString:@"product_type" :@"pants"]; [productAttr2 setAttrDataString:@"color" :@"blue"]; [productAttr2 setAttrDataInt:@"size" :42]; [productAttr2 setAttrDataInt:@"cruurent_point" :23433]; [productAttr2 setAttrDataBool:@"promotion" :false]; // Product Model AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2" productName:@"productName2" price:23456.22 quantity:1 discount:2500.33 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"] productAttrsMap:productAttr2]; //productList Array NSMutableArray *productArray = [NSMutableArray array]; [productArray addObject:product1]; [productArray addObject:product2]; //refund API [adBrix commerceRefundWithAttrWithOrderId:@“orderID1” productInfo:productArray penaltyCharge:25000.00 orderAttr:attrModel]; }
Product search
You can analyze event which user search certain product using adbrix SDK API.
Product search API require information that API already pre-defined.
- keyword : (required)
- product id : (required)
- product name : (required)
- price : (required)
- quantity : (required)
- discount : (optional)
- currency string : (optional)
- category : (optional)
- (void)searchResultEvent { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Create Event AttrMode AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel alloc]; [productAttr2 setAttrDataString:@"product_type" :@"pants"]; [productAttr2 setAttrDataString:@"color" :@"blue"]; [productAttr2 setAttrDataInt:@"size" :42]; [productAttr2 setAttrDataInt:@"cruurent_point" :23433]; [productAttr2 setAttrDataBool:@"promotion" :false]; // Product Model AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2" productName:@"productName2" price:23456.22 quantity:1 discount:2500.33 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"] productAttrsMap:productAttr2]; //productList Array NSMutableArray *productArray = [NSMutableArray array]; [productArray addObject:product1]; [productArray addObject:product2]; // product search api [adBrix commerceSearchWithAttrWithProductInfo:productArray keyword:@"상품 검색어" orderAttr:attrModel]; }
Product Share
You can analyze event which user share certain product using adbrix SDK API.
Product share API require information that API already pre-defined.
- product id : (required)
- product name : (required)
- price : (required)
- quantity : (required)
- discount : (optional)
- currency string : (optional)
- category : (optional)
- product attr map : (optional)
- (void)shareEvent() { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Product share API [adBrix commerceShareWithAttrWithChannel:AdBrixRmSharingChannelAdBrixRmSharingWeChat productInfo:product1 orderAttr:attrModel]; }
List view
You can analyze event which user viewing product list using adbrix SDK API.
List view API require information that API already pre-defined.
- product id : (required)
- product name : (required)
- price : (required)
- quantity : (required)
- discount : (optional)
- currency string : (optional)
- category : (optional)
- product attr map : (optional)
- (void)listViewEvent() { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Create Event AttrMode AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel alloc]; [productAttr2 setAttrDataString:@"product_type" :@"pants"]; [productAttr2 setAttrDataString:@"color" :@"blue"]; [productAttr2 setAttrDataInt:@"size" :42]; [productAttr2 setAttrDataInt:@"cruurent_point" :23433]; [productAttr2 setAttrDataBool:@"promotion" :false]; // Product Model AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2" productName:@"productName2" price:23456.22 quantity:1 discount:2500.33 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"] productAttrsMap:productAttr2]; //productList Array NSMutableArray *productArray = [NSMutableArray array]; [productArray addObject:product1]; [productArray addObject:product2]; // list view API [adBrix commerceListViewWithAttrWithProductInfo:productArray orderAttr:attrModel]; }
Cart view
You can analyze event which user viewing cart using adbrix SDK API.
Cart view API require information that API already pre-defined.
- product id : (required)
- product name : (required)
- price : (required)
- quantity : (required)
- discount : (optional)
- currency string : (optional)
- category : (optional)
- product attr map : (optional)
- (void)cartViewEvent() { // Create AdBrix Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Productoption AttrModel AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel alloc]; [productAttr1 setAttrDataString:@"product_type" :@"computer"]; [productAttr1 setAttrDataString:@"color" :@"black"]; [productAttr1 setAttrDataInt:@"size" :36]; [productAttr1 setAttrDataInt:@"cruurent_point" :123456]; [productAttr1 setAttrDataBool:@"promotion" :true]; // Product Model AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1" productName:@"productName1" price:10000.00 quantity:1 discount:2500.00 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"] productAttrsMap:productAttr1]; // Create Event AttrMode AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel alloc]; [productAttr2 setAttrDataString:@"product_type" :@"pants"]; [productAttr2 setAttrDataString:@"color" :@"blue"]; [productAttr2 setAttrDataInt:@"size" :42]; [productAttr2 setAttrDataInt:@"cruurent_point" :23433]; [productAttr2 setAttrDataBool:@"promotion" :false]; // Product Model AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2" productName:@"productName2" price:23456.22 quantity:1 discount:2500.33 currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW] category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"] productAttrsMap:productAttr2]; //productList Array NSMutableArray *productArray = [NSMutableArray array]; [productArray addObject:product1]; [productArray addObject:product2]; // cart view api [adBrix commerceCartViewWithAttrWithProductInfo:productArray orderAttr:attrModel]; }
Payment information
You can analyze event which user reviewing payment information using adbrix SDK API.
- (void)paymentInfoAddedEvent() { // Create AdBrixRM instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // payment attrModel AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataString:@"paymentinfo" :@"creditCard"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // payment view api [adBrix commercePaymentInfoAddedWithAttrWithPaymentInfoAttr:attrModel]; }
Game analysis
You can analyze in-game event like level up, stage complete, etc using adbrix SDK API.
adbrix SDK provides 4 pre-defined game API
- Tutorial complete
- Character create
- Stage complete
- Level up
Tutorial complete
You can analyze event which user complete game tutorial using adbrix SDK API.
Tutorial complete API require information that API already pre-defined.
- isSkip : (required) set which user complete tutorial or skip the tutorial
-(void) tutorialCompleteEvent { // create AdBrixRM instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; //Tutorial complete API [adBrix gameTutorialCompletedWithAttrWithIsSkip:false gameInfoAttr:attrModel]; }
Create Character
You can analyze event which user create a game character using adbrix SDK API.
-(void) characterCreatedEvent { // create AdBrixRM instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; //Create character API [adBrix gameCharacterCreatedWithAttrWithGameInfoAttr:attrModel]; }
Stage complete
You can analyze event which user complete game certain stage using adbrix SDK API.
Stage complete API require information that API already pre-defined.
- StageName : (required) Name of complete stage
-(void) stageClearedEvent { // create AdBrixRM instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; //Stage complete API [adBrix gameStageClearedWithAttrWithStageName:@"1-43" gameInfoAttr:attrModel]; }
Level up
You can analyze event which user level up in game using adbrix SDK API.
Level up API require information that API already pre-defined.
- Level : (required)
-(void) levelAchievedEvent { // create AdBrixRM instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Create Event AttrMode AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel alloc]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"gender" :@"male"]; [attrModel setAttrDataInt:@"age" :36]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; //level up API [adBrix gameLevelAchievedWithAttrWithLevel:122 gameInfoAttr:attrModel]; }
Comments
0 comments
Please sign in to leave a comment.