Integrating CAS SDK into an app is the first step toward displaying ads and earning revenue. Once you've integrated and initialized the SDK, you can choose an ad format and follow the steps to implement it.
- Use Xcode
26.0or higher - Target minimum iOS
13.0or higher
Follow these steps to integrate CAS.AI framework with CocoaPods. CocoaPods is a dependency manager for Objective-C and Swift; it automates and simplifies the SDK integration process.
The Podfile is a specification that describes the dependencies of the targets of one or more Xcode projects. You could use a pod init command to create the Podfile with smart defaults.
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/cleveradssolutions/CAS-Specs.git'use_frameworks!CAS.AI is a mediation SDK with no built-in live ad inventory. At least one ad network adapter or solution must be integrated before publishing to display ads and generate revenue.
Choose an integration path based on your app's target audience. If you're unsure which solution best fits your application, please contact your account manager.
During development, you can test ad formats using Test Ads without adding any ad network SDKs.
Recommended for most applications targeting a general or mixed audience. Includes a broad set of stable, high-performance networks.
pod 'CleverAdsSolutions-SDK/Optimal', '4.7.4'Networks included: Google Ads, Unity Ads, IronSource, LiftoffMonetize, InMobi, Yango Ads, Mintegral, Pangle, DTExchange, AppLovin, AudienceNetwork, Bigo, CASExchange, Maticoo, YSONetwork, Monetrix
- Open Xcode
<Project>.xcodeproj - Go to the Build Settings section for the app target
- Find the
OTHER_LDFLAGSproperty, if customized. - Make sure the
$(inherited)flag is at the beginning of the list.
Open the terminal window and run:
cd into/your/project/folderRun pod install with repo update:
pod updateMake sure that after Pod installation complete in the terminal, there are no issues that need to be fixed. Repeat the installation after resolving issues.
Read more about Cocoapods troubleshooting.
Make sure to always open the Xcode workspace instead of the project file when building your project:
open <Project>.xcworkspaceThe Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system, automating the process of downloading, compiling, and linking dependencies.
To add CAS as a package dependency to your Xcode project:
- Select File > Add Package Dependency
Enter the CAS Git repository URL into the Search or Enter Package URL field:
https://github.com/cleveradssolutions/CAS-iOS- Specify the Up to Next Minor version:
4.7.4.
- Click Add Package.
- Add each CAS adapter you want to use for monetization to your app target.
- Open the Build Settings for your app target.
- Locate the
OTHER_LDFLAGSsetting.
- Ensure that
$(inherited)and the-ObjCflag are at the beginning of the list.
CAS.AI is a mediation SDK with no built-in live ad inventory. At least one ad network adapter must be integrated before publishing to display ads and generate revenue.
Please note that SPM integration does not support certain adapters due to limitations of the ad frameworks. If you need to use these adapters, consider using the CocoaPods integration instead.
During development, you can test ad formats using Test Ads with adding Clever Ads Solution framework only.
For projects where you cannot use CocoaPods during Xcode build, you need to manually collect all frameworks from the CAS Pod dependencies and add them to the project. Our script, which can be found in the repository here, will assist you with this process.
Your project Info.plist requires additional configurations that can be performed automatically by a special script.
- Download the casconfig.rb
- Place the script in directory with the app
.xcodeproj - Open the terminal window and run command:
cd into/your/project/folder- Run ruby script:
ruby casconfig.rb <CAS_ID>For more details about the script and its updates, please refer to the the CAS iOS repository.
Repeat the script before every update of the application to make sure you are using up-to-date configurations.
Instead of using the casconfig.rb script, you can manually complete additional steps to configure your project. (Not recomended)
To display the App Tracking Transparency authorization request for accessing the IDFA, update your Info.plist to add the NSUserTrackingUsageDescription key with a custom message describing your usage. Below is an example description text:
<key>NSUserTrackingUsageDescription</key>
<string>Your data will remain confidential and will only be used to provide you a better and personalised ad experience</string>Name in Xcode Property List Editor: Privacy - Tracking Usage Description