/
1.0.0 - iOS SDK - OutStream
1.0.0 - iOS SDK - OutStream
Prerequisites
Wrapper
For creating a wrapper, you can follow this small guide: Creating a Wrapper.
Show the Ad
In the example we are using a Test Id.
If you are not testing the app, change it for the proper ID that you got from us.
The method below will add an Ad to the provided wrapper.
func addOutstrem(wrapper:UIView){
let configurationID = ConfigBuilder.companion.VIDEO_OUTSTREAM_TEST_R89_CONFIG_ID
RefineryAdFactory.shared.createVideoOutstreamBanner(configurationID: configurationID, wrapper: wrapper, lifecycleCallbacks: nil)
}
Lifecycle Events
You can subscribe to these events with the same method by passing a new instance of BannerEventListener
as a lifecycleCallbacks
parameter to the createBanner
method. Details about this object can be found in the Reference.
Here is what the implementation looks like.
First, extend from the BannerEventListener
.
class BannerEventLogger: BannerEventListener {
override func onLayoutChange(width: Int32, height: Int32) {
print("onLayoutChange","width=\(width)","height=\(height)")
}
override func onLoaded() {
print("onLoaded")
}
override func onOpen() {
print("onOpen")
}
override func onClick() {
print("onClick")
}
override func onClose() {
print("onClose")
}
override func onImpression() {
print("onImpression")
}
override func onFailedToLoad(error: R89LoadError) {
print("onFailedToLoad","error=\(error)")
}
}
Next, provide the instance of BannerEventLogger
to createBanner
method, via lifecycleCallbacks
parameter.
func addOutstrem(wrapper:UIView){
let configurationID = ConfigBuilder.companion.VIDEO_OUTSTREAM_TEST_R89_CONFIG_ID
let bannerEventLogger = BanneEventLogger()
RefineryAdFactory.shared.createVideoOutstreamBanner(configurationID: configurationID, wrapper: wrapper, lifecycleCallbacks: bannerEventLogger)
}
, multiple selections available,
Related content
1.0.0 - iOS SDK - Banner
1.0.0 - iOS SDK - Banner
More like this
Outstream
Outstream
More like this
1.0.0 - Outstream
1.0.0 - Outstream
More like this
1.0.0 - Flutter - OutStream
1.0.0 - Flutter - OutStream
More like this
1.0.0 - iOS SDK - Creating a Wrapper
1.0.0 - iOS SDK - Creating a Wrapper
More like this