RecommendationsApi class abstract

The Recommendations contract, for consumers that want to depend on an interface rather than Recommendations's statics directly — e.g. a publisher's own Clean Architecture layer holding this behind its own infrastructure adapter, or MockRecommendations (package:teads_flutter/teads_flutter_mocks.dart) in a test.

Implementers

Constructors

RecommendationsApi()

Properties

adChoicesUrl → Future<String?>
The URL your AdChoices icon must open when tapped. Null if native has none.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

fetch(RecommendationsPlacementConfig config) → Future<List<TeadsRecommendation>>
Fetches recommendations for config. Throws a PlatformException if the native fetch fails.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerClick(TeadsRecommendation recommendation) → Future<String?>
Resolves recommendation's destination URL at the moment of an actual user tap — and, for an organic recommendation, reports the click to the traffic endpoint as native's own getUrl(rec) does. Returns null if recommendation has no TeadsRecommendation.clickId. Throws a PlatformException with code click_id_not_found if native no longer has the recommendation cached.
release(List<TeadsRecommendation> recommendations) → Future<void>
Proactively frees native's cached click-lookup entries for recommendations — call this once a fetched list is no longer shown (e.g. from the publisher widget's dispose()).
setTestRtb(bool enabled) → Future<void>
Forces paid (RTB) recommendations into fetch responses, so the disclosure-icon handling can be tested without a live campaign. Process-wide; set it before fetch. Remove before release.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited