Integration
1. SDK Integration
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 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 test mode
//[BideaseSDK enableTestMode];
//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 test mode
//BideaseSDK.enableTestMode()
//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
}
. . .
}
Notes
- Formats: Make sure that only the ad formats you use are listed in the
formatsarray. - Test Mode and Logs:
- Uncomment the lines
enableTestModeorenableDebugLogsto enable these options during testing (code activation). Test mode must be disabled before submitting the app to the store. - Additionally, Bidease can enable Test Mode per bundle on the server side - this option is recommended for first integrations. 👉 Contact your Bidease manager to activate or deactivate it during QA.
- Ensure IDFA/GAID tracking is enabled during QA so the Bidease team can review logs and assist with troubleshooting if needed.
- Uncomment the lines
- User Data & Consent: The Bidease SDK collects certain data from end users.
- For GDPR (EU) and CCPA (California), use a third-party Consent Management Platform (CMP) to obtain user consent before initializing the SDK.
- For COPPA, indicate whether your app is child-directed before starting the SDK:
BideaseSDK.subjectToCOPPA = @NO;//NO means that the app is not a subject to COPPA regulations(user is not a child), you should pass YES otherwise.BideaseSDK.subjectToCOPPA = false;//false means that the app is not a subject to COPPA regulations(user is not a child), you should pass true otherwise.3. 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:
Next steps
- Integrate additional Ad Types.
Updated 10 days ago