Installation steps
The existing customer - already using the Bluekai SDK
- Delete the libBluekai.a and Bluekai.h files manually from the project
- Remove the references of above files under build settings / build phases etc
- 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.
- Open your app or module under Xcode
- Tap on the project in the Project Navigator
- Select Target
- Select General Tab
- Navigate to Frameworks, Libraries, and Embedded Content section
- Add new framework by selecting + icon and then click Add Other > Add Files
- Select
OracleCXMobileSDK.framework
&OracleCXAdvertising.framework
from your downloaded location
After the above steps, we can see the frameworks under Embedded Content section like below
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 Custom iOS Target Properties list present in the Info tab (Targets)
- Type “Privacy - Tracking” in the search box
- Select “Privacy - Tracking Usage Description” in the search box
- Select the value box for the above key and provide the description text.
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.