Digiteka allows you to integrate a single SDK into your app, and serve "outstream" video or display ads. Sample app includes DigitekaSDK.xcframework and is showing integration example.
Clone this repository, open it with Xcode, and run project.
There are some prerequisites before installing the SDK.
DigitekaSDK is distributed through Swift Package Manager.
To integrate the SDK into your Xcode project using SPM, specify package repository url :
https://github.com/digiteka/outstream-ios-sdk
Your Info.plist
should contains these keys:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsForMedia</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
Starting with iOS 14, your application will have to ask for consent before tracking the user.
You can find more information about this integration in Apple's documentation
import DigitekaSDK
let dtkConfig = DTKConfig(
baseUrl: "<Your baseUrl>",
mdtk: "<Your mdtk>")
Digiteka.getInstance().initialize(dtkConfig)
OutstreamView
or specify this custom class to your xib or storyboard file, and connect it with @IBOutlet
@IBOutlet weak var outstreamView: OutstreamView!
OutstreamView
with the OutstreamViewConfig
and a delegate (optional):let outstreamViewConfig = OutstreamViewConfig(
urlReferer: "<Your url referer>",
zone: <Your zone>,
adUnit: "<Your adUnit (Optional)>")
outstreamView.initialize(config: outstreamViewConfig, delegate: self)
extension <Your ViewController class>: OutstreamViewDelegate {
func didUpdateHeight(_ ad: OutstreamView, height: CGFloat) {
//Called when the height of the ad has changed
}
func onClose(_ ad: OutstreamView) {
//Called when the ad closed
}
func didReceiveAd(_ ad: OutstreamView) {
//Called when you get an ad
}
}
The ad is loaded with load()
method.
outstreamView.load()