Installation steps

The existing customer - already using the Bluekai SDK

  1. Delete the libBluekai.a and Bluekai.h files manually from the project
  2. Remove the references of above files under build settings / build phases etc
  3. Remove the below import from all the files and follow the instructions mentioned under New customer section - #import "Bluekai.h"

New customer

Download the latest Oracle CX Mobile SDK & Oracle CX Advertising SDK(link to be added). To import these frameworks into the Xcode project follow the below steps. These steps are relevant as of Xcode version 12.

  1. Open your app or module under Xcode
  2. Tap on the project in the Project Navigator
  3. Select Target
  4. Select General Tab
  5. Navigate to Frameworks, Libraries, and Embedded Content section
  6. Add new framework by selecting + icon and then click Add Other > Add Files
  7. Select OracleCXMobileSDK.framework & OracleCXAdvertising.framework from your downloaded location

After the above steps, we can see the frameworks under Embedded Content section like below

Embedded framework screenshot

iOS 14+ ATT Support

After adding Oracle CX Advertising SDK to your app, if you want to be able to send data to backend server in iOS14+ versions, it is important to prompt the end user informing that the data is being collected by application for personalised advertisement. The prompt text has to be compulsorily provided as value for NSUserTrackingUsageDescription key in Info.plist.

<string>${PRODUCT_NAME} collects data for personalized advertising.</string>

Alternatively, you can view Info.plist as property list, and follow the below steps. 1.Click “+” Button under Information Property List

  1. Type “Privacy - Tracking” in the search box
  2. Select “Privacy - Tracking Usage Description” in the search box
  3. Select the value box for the above key and provide the description text.

Screenshot

Screenshot

Setup the SDK

There are two ways we can set up the Oracle CX Advertising SDK.

1. With oracle.json

This is a recommended way to set up the SDK. oracle.json is a single configuration file for all different CX modules. The sample oracle.json file can be found here. Place the oracle.json file in the main project folder and update the file with your own values. More details about oracle.json can be found in Oracle CX Mobile SDK documentation. Below are the steps to configure the SDK in Swift and Objective C

Swift 5.1
import OracleCXAdvertising

class ViewController: UIViewController, BlueKaiOnDataPostedListener {
    let blueKaiObj = BlueKai()
    let container = ORAAdvDataContainer()

    override func viewDidLoad() {
        super.viewDidLoad()
        container.loadFromConfigFile()
        blueKaiObj.delegate = self
    }
}
Objective C
#import <OracleCXAdvertising/OracleCXAdvertising.h>

@interface ViewController : UIViewController

@property (nonatomic, strong) BlueKai *bluekai;
@property (nonatomic, strong) ORAAdvDataContainer *container;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.bluekai = [[BlueKai alloc] init];
    self.container = [[ORAAdvDataContainer alloc] init];
    [self.container loadFromConfigFile];
    self.bluekai.delegate = (id)self;
}

@end
2. Without oracle.json

Below is the implementation without oracle.json. This is not recommended, and the initialisation method is deprecated.

Swift 5.1
import OracleCXAdvertising

class ViewController: UIViewController, BlueKaiOnDataPostedListener {
    var blueKaiObj : BlueKai!

    override func viewDidLoad() {
        super.viewDidLoad()
        self.blueKaiObj = BlueKai.init(siteId: "2", appVersion: "1.2", devMode: false)
        self.blueKaiObj.delegate = self
    }
}
Objective C
#import <OracleCXAdvertising/OracleCXAdvertising.h>

@interface ViewController : UIViewController

@property (nonatomic, strong) BlueKai *bluekai;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.bluekai = [[BlueKai alloc] initDirectAutoIdfaEnabledWithSiteId:@"2" withAppVersion:@"2.0" withDevMode:YES];
    self.bluekai.delegate = (id)self;
}

@end

Updating the Oracle CX Advertising SDK in future releases

Updating Oracle CX Advertising SDK to newer versions from current Oracle CX Advertising SDK version, can be done by just copying over the previous version, unless otherwise indicated.