-jio-start-block-type-2
-jio-style-title
Call the following API on your app's launch AppDelegate's didFinishLaunchingWithOptions()
function.
JioAdSdk.initialize()
or
JioAdSdk.initialize(environment: "Production")
cleanup will be taken care by SDK itself at JioAdSdk.initialize()
-jio-style-title
JioAdSdk.setPackageName(packageName: "<APP PACKAGE>")
If this is not set, then SDK reads by default app package.
-jio-style-title
If needed, enable / disable debug logs for the JioAds SDK by calling setLogLevel()
API
JioAdSdk.setLogLevel(logLevel: .debug)
Possible values for LogLevel
are as below:
-jio-tables
Log Level Parameter Value | Description |
---|---|
LogLevel.none |
Disable Logs (No logs will be printed) |
LogLevel.debug |
To enable debug logs |
-jio-style-title
To Fetch IDFA, App needs to call below requestAppTrackingPermission()
function. Refer the below code for call and implementation requestAppTrackingPermission()
function.
func applicationDidBecomeActive(_ application: UIApplication) {
if #available(iOS 14, tvOS 14, *) {
requestAppTrackingPermission { (status) in
if status == .denied {
DispatchQueue.main.async {
NSLog("Access denied")
}
}
}
}
}
extension AppDelegate {
@available(iOS 14, tvOS 14, *)
func requestAppTrackingPermission(_ completion: @escaping (ATTrackingManager.AuthorizationStatus) -> Void) {
ATTrackingManager.requestTrackingAuthorization { (status) in
switch status {
case .authorized:
// racking authorization dialog was shown and we are authorized
JioAdSdk.fetchBpid()
case .denied:
// Tracking authorization dialog was shown and permission is denied
SDKLog("AdTracking | status: Denied")
case .notDetermined:
// Tracking authorization dialog has not been shown
SDKLog("AdTracking | status: Not Determined")
case .restricted:
SDKLog("AdTracking | status: Restricted")
@unknown default:
SDKLog("AdTracking | status: Unknown")
}
completion(status)
}
}
}
-jio-end-block-type-2