Closed shinwan2 closed 10 months ago
Hi @shinwan2 ! Thanks for the good finding!
I wouldn't expose unregisterView
in order not to miss firing the impression event or process the user click unintentionally due to the publisher's code.
However, it totally makes sense to review CPU consumption, especially after the ad is already displayed and all needed trackers are processed.
Can you share the part of your logs related to the Prebid SDK so we can study it to address the issue?
Hi @YuriyVelichkoPI.
Below is the log that the internal timer prints after nativeAd.registerView
is called. I have only rendered 4 ads in a UITableView
.
I wouldn't expose unregisterView in order not to miss firing the impression event or process the user click unintentionally due to the publisher's code.
I understand your concern. After https://github.com/prebid/prebid-mobile-ios/pull/900/files#diff-a11c923043093ee266f7b9a42a9ca8e6e508fc0e7078815a469a10e635f1b62bR39 I saw that the viewForTracking
is made weak var
. What about stopping the timer when the viewForTracking
is null
? In my case I don't reuse UITableViewCell
so when they are out of the viewport, they are deinit
.
Thanks for the logs and the advice, @shinwan2 !
@alexsavelyev, this ticket should be prioritized for the next release.
Is your feature request related to a problem? Please describe.
I'm trying to place an ad as a
UITableViewCell
for every 4 contents. It works great by usingbut when I scroll down, the log becomes too noisy because invisible ads keep their viewability timer running. I feel it's not CPU-friendly when I have more than 10 ads in a list.
Describe the solution you'd like Can we expose
unregisterViewFromTracking
inNativeAd
so I can call it like below?Describe alternatives you've considered
I've tried using
but the timer keeps running.