-
Notifications
You must be signed in to change notification settings - Fork 8
Getting Started
Apple introduced a new AppTrackingTransparency framework and tracking permission in iOS 14. To support these changes you will need to make a couple of small changes in Adform Tracking SDK integration.
- Ask the user for permission to access the Advertising Identifier using
requestTrackingPermissions
method. Calling this method will present a systemic permissions alert, therefore it's up to you to decide when it is most appropriate to show it.
Swift
if #available(iOS 14.0, *) {
AdformSDK.requestTrackingPermissions(nil)
}
Objective-C
if (@available(iOS 14.0, *)) {
[AdformSDK requestTrackingPermissions:nil];
}
- Add
NSUserTrackingUsageDescription
entry to your appsInfo.plist
file.
Adform Advertising SDK is fully compatible with Apple security requirements and supports ATS, so no additional changes required for that.
In iOS 9 you must whitelist any URL schemes that your App wants to query. Our sdk uses "sms" and "tel" URL schemes to determine if device can send sms and make phone calls. Therefore, to avoid possible problems on IOS9 we recommend you to add "sms" and "tel" schemes to the white-list. To do so, developers should add the following to their plist:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>sms</string>
<string>tel</string>
</array>
The use of Adform SDK requires the following:
- Xcode 14.0 or later.
- Requires deployment target 9.0 or later
SDK is Automatic Reference Counting (ARC) compliant.
The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
You can add Adform Advertising SDK as a dependency to your project through Xcode UI or add it to your project's Package.swift
file like this:
dependencies: [
.package(url: "https://github.com/adform/adform-ios-sdk", .upToNextMajor(from: "2.19.0"))
]
Important! Xcode 12 has a bug where static frameworks distributed through SPM sometimes get embedded incorrectly into the app. This issue is mentioned in Xcode 12.4 release notes. If the validation of your archived app fails you may need to use a workaround that strips the embedded frameworks after the build. You can use this build phase script to remove embedded frameworks from the app:
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
rm -rf "${APP_PATH}/Frameworks/AdformAdvertising.framework"
rm -rf "${APP_PATH}/Plugins/AdformAdvertising.framework"
Adform Advertising SDK is available via CocoaPods. To integrate SDK using CocoaPods, you need to edit Podfile
and specify the AdformAdvertising
pod.
pod 'AdformAdvertising', '~> 2.19.0'
For more information about CocoaPods visit CocoaPods site.
Adform Advertising SDK is available via Carthage.
- To integrate SDK using Carthage, you need to specify it in
Cartfile
.
binary "https://raw.githubusercontent.com/adform/adform-ios-sdk/master/AdformAdvertising.json" ~> 2.19.0
- Adform Advertising SDK is distributed as a static framework. Therefore, you should not add it as input/output files in Carthage copy-frameworks Build Phase.
For more information about Carthage visit Carthage site.
- Download the latest build version of Adform Advertising SDK.
- Drag AdformAdvertising.xcframework to your project.
- When asked select Copy items into destination group's folder.
-
Then select AdformAdvertising.xcframework in the project navigator, go to file inspector, and add it to your application's target (Target Membership).
-
Finally import AdformAdvertising and you are ready to use Adform mobile banners:
Swift
import AdformAdvertising
Objective-C
@import AdformAdvertising;
-
First of all, try enabling Debug mode to see additional SDK logs in the console. You can find instructions how to do so here.
-
If you get a
missing symbols error
, it may mean that automatic framework linking has failed, in this case try to add these dependencies explicitly to your project:-
UIKit.framework
; -
CoreGraphics.framework
; -
QuartzCore.framework
; -
SystemConfiguration.framework
; -
MediaPlayer.framework
; -
AdSupport.framework
; -
CoreTelephony.framework
; -
CoreLocation.framework
; -
CoreMedia.framework
; -
AVFoundation.framework
; -
SafariServices.framework
; -
WebKit.framework
; -
AppTrackingTransparency.framework
;
-
-
If you get a
bundle format unrecognized, invalid, or unsuitable
error while integrating the SDK, it probably means one of two problems:- That you are integrating SDK with Carthage and have added AdformAdvertising.framework to input/output files in Carthage copy-frameworks Build Phase. You should not add this framework to copy-frameworks Build Phase.
- You have selected
Embed
in Framework and Libraries project configuration. This configuration should be selected toDo Not Embed
.
To start coding check basic AdInline integration guide.
Basic integrations
- Integrating Inline Ad
- Integrating Full Screen Overlay Ad
- Integrating AdHesion Ad
- Integrating Interstitial Ad
- Video Ad Integration
- Debug mode
- Troubleshooting
Advanced integrations
- Advanced Inline Ad Integration
- Integrating Inline Ads in UITableView
- Advanced Full Screen Overlay Ad Integration
- Advanced Interstitial Ad Integration
- Instream Video Ads
Other
- Adding Custom Values
- Adding Keywords
- Adding Key Value Pairs
- Adding Search Words
- Location Tracking
- Security
- Ad Tags
- Header Bidding
- Changing ADX Domain
- Specifying banner loading behaviour
- Customizing in app browser
- GDPR
- US Privacy
- Localization
- In app deeplinks
Mediation adapters