iOS
1. SDK Integration
Bidease SDK for iOS supports Xcode 16.2 or later. To integrate the Bidease SDK into your Xcode project using CocoaPods, add the following to your Podfile:
platform :ios, '12.0'
target 'BideaseTest' do
use_frameworks!
pod 'BideaseSDK/BideaseRTB'
endThen run the following commands in your macOS terminal (or via CocoaPods.app):
$ cd path_to_Podfile
$ pod update⚠️ Make sure to always use the latest available SDK versions from Bidease.
2. Add Required Keys
In your Xcode project settings, navigate to: YourProject ➡️ Info ➡️ Custom iOS Target Properties. Right-click on any row in the table and choose Show Raw Keys/Values. Then add the following:
- Add the key
NSUserTrackingUsageDescriptionwith the value:Your data will be used to deliver personalized ads to you. - Add the key
LSApplicationQueriesSchemesas an array with the following values:fb,instagram,tumblr,twitter,itms-app,itms-apps,itms-appss - Locate the key
NSAppTransportSecurity:- If it doesn’t exist, create it.
- Expand the section (triangle icon) and add these subkeys:
NSAllowsArbitraryLoads→ YESNSAllowsArbitraryLoadsForMedia→ YESNSAllowsArbitraryLoadsInWebContent→ YES
- Add SKAdNetworkItem identifiers into the
SKAdNetworkItemsarray. You can copy the required identifiers from the following file: SKAdNetworkItems.
The final setup in your Info.plist should look similar to the example below:
3. Add the SDK initialization code
#import <Bidease/Bidease.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>
...
-(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
if (@available(iOS 14, *)) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus s){}];
});
}
//Uncomment the line below if you need logs
//[BideaseSDK enableDebugLogs];
[BideaseSDK startWithCompletion:^(BOOL success, NSError* __nullable error, BOOL isConnectionError) {
if (success)
{
NSLog(@"SDK start succeded");
}
else
{
//You should try to start the SDK again after some time
NSLog(@"SDK start failed");
}
}];
//...
return YES;
}import Bidease
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if #available(iOS 14, *) {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: {
ATTrackingManager.requestTrackingAuthorization(completionHandler: { (_) in })
})
}
//Uncomment the line below if you need logs
//BideaseSDK.enableDebugLogs()
BideaseSDK.start { success, error, isConnectionError in
if success {
print("SDK start succeded")
} else {
//You should try to start the SDK again after some time
print("SDK start failed")
}
}
. . .
return true
}
. . .
}
import SwiftUI
@main
struct MyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self)
var appDelegate
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
/////////////////////////////////////////////////////////////////////////
import UIKit
import Bidease
import AppTrackingTransparency
class AppDelegate: NSObject, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
if #available(iOS 14, *) {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
ATTrackingManager.requestTrackingAuthorization { _ in }
}
}
// Uncomment if you need logs
// BideaseSDK.enableDebugLogs()
BideaseSDK.start { success, error, isConnectionError in
if success {
print("SDK start succeeded")
} else {
print("SDK start failed")
}
}
// . . .
return true
}
}Notes
- Formats: Make sure that only the ad formats you use are listed in the
formatsarray. - Logs:
- Uncomment the line
enableDebugLogsto enable this option during testing (code activation). - Ensure IDFA/GAID tracking is enabled during QA so the Bidease team can review logs and assist with troubleshooting if needed.
- Uncomment the line
Next steps
- Integrate additional Ad Types.
Updated 13 days ago