GuidesDiscussions
Log In
Guides

Invocation of SDK

To Invoke DR SDK from the Host App include the following lines of code.

1. AppDelegate File

#import "AppDelegate.h"
#import <DigitalReefSDK/DigitalReefSDK.h>

@interface AppDelegate ()
@property (nonatomic, strong) DigitalReef *digitalReef;
@end

@implementation AppDelegate

- (instancetype)init{
    self = [super init];
    if(self){
        self.digitalReef = DigitalReef.shared;
    }
    return self;
}
import UIKit
import DigitalReefSDK

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    
    var window: UIWindow?
    
    var digitalReef: DigitalReef = DigitalReef.shared

    //….
}

2. Push Notification Permission

DR SDK needs to request Push Notification permission from the user to display the Ad Notifications. Below is the sample code to invoke the same from any View Controller class.

[DigitalReef.shared requestPushPermission];
DigitalReef.shared.requestPushPermission()

3. App Tracking Permission

DR SDK needs to request App Tracking permission from the user to collect IDFA details and track user activity on DR Platform. Below is the sample code to invoke the same from any View Controller class.

[DigitalReef.shared requestAppTrackingTransparencyPermission];
DigitalReef.shared.requestAppTrackingTransparencyPermission()

4 Custom Org selection (Optional)

In case the Client wishes to have a same app available for different organisation, this can be done by calling the following API to DR SDK.

// Pass the countryCode which is configured on DigitalReef server.

[DigitalReef.shared sendHostAppCountryCodeWithCc:@"value"];

// createOrganisationFromCountryCode  - refers to internal 
// configuraiton creattion inside the SDK.

//Example 1 :
[DigitalReef.shared sendHostAppCountryCodeWithCc:@"BR"];

//Example 2 :
[DigitalReef.shared sendHostAppCountryCodeWithCc:@"CHL"];

//Example 3 :
[DigitalReef.shared sendHostAppCountryCodeWithCc:@"Peru"];

// Pass the countryCode which is configured on DigitalReef server.

DigitalReef.shared.sendHostAppCountryCode(cc: "value")

// createOrganisationFromCountryCode  - refers to internal 
// configuraiton creattion inside the SDK.

//Example 1 :

DigitalReef.shared.sendHostAppCountryCode(cc: "BR")

//Example 2 :
DigitalReef.shared.sendHostAppCountryCode(cc: "CHL")

//Example 3 :
DigitalReef.shared.sendHostAppCountryCode(cc: "Peru")


🚧

Keeping the mapping updated on server

Please ensure that the Country code mapping is created in Digital Reef servers before going live. Mapping will help getting the Devices registered to service and not in a holding pattern to get the details from server.

🚧

Check for Support

This feature is available only based on request. Wrongly calling this would result in failure of SDK.

Connect with your contact in DigitalReef to know more about this feature

Currently available only for Native Android apps.

5 Get Client ID (Optional)

In order to facilitate testing, you can obtain the client ID calling the follow method.

NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
let idfv = UIDevice.current.identifierForVendor?.uuidString.lowercased() ?? ""