prebid / prebid-mobile-ios

Prebid Mobile SDK for iOS applications
Apache License 2.0
47 stars 88 forks source link

Expire ads respectively to the `seatbid.bid.exp` #850

Open YuriyVelichkoPI opened 1 year ago

YuriyVelichkoPI commented 1 year ago

Background

The OpenRTB protocol defines the bid.exp property that:

Advisory as to the number of seconds the bidder is willing to wait between the auction and the actual impression.

Since the In-App Native API and Rendering API, in fact, cache the bid until it isn't displayed, the SDK should utilize the bid.exp field to expire the cache or the respective Ad Object - BannerView, Interstitial controller, etc.

Objectives

In-App Native

It looks like the CacheManager for In-App Native ads utilizes the value of bid.exp to invalidate the cached bid. However, there are no unit tests not for Bid class not for the CacheManager.shared.save with the expireInterval.

So for the scope of the Native Ads need to add unit tests for the Bid.exp property. And for
the CacheManager.shared.save method.

Also, we need to add tests to verify the invocation of NativeAd.cacheExpired delegate method because it is essential to notify the app properly and not break this behavior in the future.

Rendering API

jsligh commented 3 months ago

@YuriyVelichkoPI is this still relevant?

YuriyVelichkoPI commented 3 months ago

Yes