Issue Summary
You have integrated the Teads iOS SDK and are requesting ads. The logs indicate a successful request (or no errors are thrown), but the inRead video player is not appearing on the screen between your content paragraphs.
Symptoms
requestAdis called, butdidReceiveAdis never triggered.didReceiveAdis triggered, but the ad slot remains collapsed (height: 0px) or empty.The area where the ad should be is blank white space.
Root Causes & Solutions
There are three common integration reasons for this behavior. Please check them in the order below.
1. The "Strong Reference" Issue (Most Common)
Diagnosis: The Ad Placement object is being deallocated by ARC (Automatic Reference Counting) before the ad server can respond.
Explanation: If you declare TeadsAdPlacement as a local variable inside a function (e.g., inside viewDidLoad), it is destroyed as soon as that function finishes executing.
Solution:
Promote the placement variable to a class-level property to ensure it is retained in memory.
❌ Incorrect (Local Variable):
Swift
func loadAd() {
// This object will be destroyed immediately after this function ends
let placement = Teads.createInReadPlacement(pid: 12345, delegate: self)
placement.requestAd(settings: settings)
}
✅ Correct (Strong Property):
Swift
class ArticleViewController: UIViewController {
// Retain the placement here
var placement: TeadsInReadAdPlacement?
func loadAd() {
self.placement = Teads.createInReadPlacement(pid: 12345, delegate: self)
self.placement?.requestAd(settings: settings)
}
}
2. Missing Resize Logic (The "Zero Height" Issue)
Diagnosis: The ad is loading, but the container view remains at 0px height.
Explanation: Teads inRead ads are dynamic.1 They often initialize with a height of 0 and expand only when the creative asset is ready. If your delegate does not listen for this expansion, the ad remains invisible.
Solution:
Implement the didUpdateRatio method in your TeadsInReadAdPlacementDelegate.
✅ Code Example:
Swift
func didUpdateRatio(ad: TeadsInReadAd, adRatio: TeadsAdRatio) {
// 1. Calculate the required height for your specific width
let height = adRatio.calculateHeight(for: teadsAdView.frame.width)
// 2. Update the constraint
teadsAdHeightConstraint.constant = height
// 3. (Optional) If in a TableView, trigger a layout update
// tableView.beginUpdates(); tableView.endUpdates()
}
3. WebView Helper Configuration
Diagnosis: You are displaying article content in a WKWebView, but the SDK cannot find the insertion point.
Explanation: The native SDK cannot automatically inject views into HTML content. You must manually tag the slot in your HTML and use the Helper class.
Solution:
HTML: Ensure your article HTML contains a unique container ID:
<div id="teads-placement-slot"></div>
Swift: Initialize the
TeadsWebViewHelperpointing to that selector.
Swift
self.webViewHelper = TeadsWebViewHelper(webView: webView, selector: "#teads-placement-slot", delegate: self)
Verification Steps
To rule out inventory or account-level blocks, always validate your code using the Teads Global Test PID.
| Environment | Test PID | Expected Behavior |
|---|---|---|
| Landscape Video | 84242 | Should display a Teads demo video immediately. |
| Vertical Video2 | 1275463 | Should display a vertical demo video.4 |
How to interpret results:
If Test PID 84242 works: Your code is correct. The issue with your live PID is likely due to lack of demand, strict blocking rules, or the PID is not yet active. Contact your Account Manager.
If Test PID 84242 fails: The issue is in your implementation. Re-visit the "Strong Reference" and "Resize Delegate" sections above.
Still Stuck?
If you have verified the above and still see no player:
Enable Debug Mode:
TeadsAdPlacementSettings { $0.enableDebug() }Check your console for "AdOpportunityTracker" logs.
Submit a ticket with your logs and a screenshot of your view hierarchy.
Comments
0 comments
Please sign in to leave a comment.