Before You Start Make Sure:
Initialise the SDK upon application start. Example for one of the view controllers:
#import <DIOSDK/DIOController.h>
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[[DIOController sharedInstance] initializeWithProperties:nil appId:@"1234" completionHandler:^{
// Ready to go
} errorHandler:^(NSError *error) {
// Something wrong happened
}];
}
Note: initialisation is an asynchronous operation.
A more advanced way to initialise the SDK is by passing a DIOInitProperties object:
DIOInitProperties *properties = [[DIOInitProperties alloc] init];
[[DIOController sharedInstance] initializeWithProperties:properties appId:@"1234" completionHandler:^{
// Success
} errorHandler:^(NSError *error) {
// Failure
}];
In order to define user's gender:
[properties setGender:GENDER_MALE];
[properties setGender:GENDER_FEMALE];
In order to define if the user is a child, according to the local law:
[properties setChildCompliance:DIOComplianceUnknown];
[properties setChildCompliance:DIOComplianceYes];
[properties setChildCompliance:DIOComplianceNo];
In order to define user's year of birth:
[properties setYearOfBirth:1980];
In order to define user's keywords:
[properties setUserKeywords:@[@"iPhone", @"Apple"]];
In order to request 'Advertiser Name' and 'Advertiser Click URL' ad attributes (Infeed ads only):
[properties setDetailsRequired:YES];
Location based targeting is enabled by default, but there is a way to disable it:
[[DIOController sharedInstance] setLocationBasedTargeting:NO];
In order to disable the internal crash reporting system (this might be helpful if you use your own crash reporting system, like Crashlytics):
[properties setCrashReportsDisabled:NO]
Comments
0 comments
Please sign in to leave a comment.