📱AdSter SDK Documentation
Overview
The AdSter SDK provides integration for multiple ad types, including Banner, Interstitial, Rewarded, and Native Ads. To use the SDK, you need to configure ad requests, initialize the SDK, and conform to the necessary protocols to handle ad events such as loading, impressions, and clicks.
SDK Initialization
Before requesting any ads, you need to initialize the SDK. This is a one-time setup step that should be done at the start of your application.
Installation via CocoaPods
To integrate AdSter SDK into your Xcode project using CocoaPods, follow these steps:
Open your project's Podfile and add:
pod 'Adster', '~> 1.0.2'
Run the following command in the terminal:
pod install
After installation, close Xcode and open the .xcworkspace file instead of .xcodeproj.
Initializing the SDK
AdSter.sharedInstance().start(completionHandler: { status in
print("Ad initialized \(status)")
})
completionHandler
: A callback to confirm whether the initialization was successful.
Ad Request
To request an ad, you need to initialize the AdSterAdLoader
and configure it with the required parameters:
let loader = AdSterAdLoader()
loader.delegate = self
loader.loadAd(adRequestConfiguration: AdRequestConfiguration(
placement: key,
viewController: self,
publisherProvidedId: "Test",
customTargetingValues: ["test": "123"]
))
Parameters:
placement
: Unique key for the ad placement.viewController
: ViewController where the ad will be presented.publisherProvidedId
: Identifier for the ad unit.customTargetingValues
: Optional custom targeting values to personalize the ad request.
Last updated