-jio-start-block-type-3
¶ Dynamic Display AdsDynamic display ads adapt their content in real time to match the individual viewer's interests and behavior. They're like personalized billboards that create a more relevant and engaging experience for users. |
![]() |
Complete GETTING STARTED section and INITIALIZE SDK section before starting this section.
-jio-end-block-type-3
-jio-start-block-type-2
-jio-tables
Display Size | Typical Use Cases | API |
---|---|---|
320x50 | Mobile banner ads | jioAdViewDynamicDisplay.setDisplayAdSize(displaySizes:[.siz320x50]) |
300x50 | Mobile banner ads | jioAdViewDynamicDisplay.setDisplayAdSize(displaySizes:[.siz300x50]) |
320x100 | Large mobile banner ads | jioAdViewDynamicDisplay.setDisplayAdSize(displaySizes:[.siz320x100]) |
300x250 | Medium rectangle for sidebar placements | jioAdViewDynamicDisplay.setDisplayAdSize(displaySizes:[.siz300x250]) |
728x90 | iPad | jioAdViewDynamicDisplay.setDisplayAdSize(displaySizes:[.siz728x90]) |
728x250 | iPad | jioAdViewDynamicDisplay.setDisplayAdSize(displaySizes:[.siz728x250]) |
-jio-style-title
To Pass multiple predefined display sizes, Use below code snippet. SDK will show Ads from the passed sizes.
jioadView?.setDisplayAdSize(dynamicSizes: List<DynamicDisplaySize>)
-jio-style-title
Example:
jioAdView?.setDisplayAdSize(displaySizes: [ .size320x100, .size300x50, .size300x250, .size320x50, .size728x250, .size728x90 ])
-jio-style-title
To make Dynamic display ad Adaptive, Pass max width and max height in below API
jioAdView?.setDisplayMaxSize(maxWidth: maxDisplayWidth, maxHeight: maxDisplayHeight)
-jio-style-title
Example:
jioAdView?.setDisplayAdSize(maxWidth: 300, maxHeight: 180)
1. In case of Adaptive Dynamic Display Ad passing custom layout before cacheAd is mandatory. Refer Customize Dynamic Display Ads section for ad customization.
2. In case of Adaptive Dynamic Display ad, container width and height should not be fixed. Width should be either “match_parent” or ”wrap-content” and height should be always “wrap-content”.
3. Do not call setDisplayAdSize() and setDisplayMaxSize() APIs with same jioadview object.
-jio-style-title
Cache display ads by initializing a JioAdView, setting up an ad delegate, creating an ad container, adding the ad view, and initiating the caching process with a single call to jioAdView?.cacheAd().
jioAdView = JioAdView(adSpotId: "<ADSPOT_KEY_GOES_HERE>", adType: .dynamicDisplay, delegate: self, forPresentionClass: self, publisherContainer: adContainer)
jioAdView?.setCustomView(container: CustomContainer) // For custom layout
jioAdView?.setDisplayAdSize(displaySizes: [.size300x250])
jioAdView?.cacheAd()
-jio-style-title
Display the dynamic display Ad with a single call to adView.loadAd()
extension InstreamVC : JIOAdViewProtocol {
func onAdPrepared(adView: JioAdView) {
self.showToast(message: "onAdDataPrepared")
adView.loadAd()
}
}
-jio-style-title
Ensure proper lifecycle management by calling invalidateAd()
to destroy the Dynamic Display Ad object
self.adView?.invalidateAd()
self.adView = nil
To customize display ads, you can use the setCustomView()
method or the setCustomDisplayAdContainer()
method.
The following API supports either video or native ads:
jioAdView?.setCustomView(container: UIView?)
The following API supports both video and native ads:
jioAdView?.setCustomDisplayAdContainer(nativeContainer: UIView?, videoContainer: UIView?)
For detailed information, including TAG and examples, on customizing native ads, refer to the Customizing Native Banner Ads section or the Native Billboard Ads section and on customizing video ads, refer to the Customizing Instream Video ads section
-jio-end-block-type-2