Closed andre-arsenault closed 6 years ago
Any update on this?
Hi Andre, Unfortunately we didn't get a chance to address these issues on latest release as we were focused on MOAT development for the past month. We will include a fix for that on our next release which should occur during next week.
Sorry for the inconvenience.
Best, -Shahaf
Hi Andre, Do you create a new Mobfox ad instance for every request? Can you share an example code in which you used to request Mobfox ads?
Thanks, -Shahaf
Hi Shahaf,
I only create a Mobfox ad instance if one does not already exist. My code is based on the provided Cordova plugin, with changes. You can see the iOS version here. The calling code enters in showBanner
, which calls into createBanner
. I save the Mobfox ad instance in the banner
data member.
From my testing, the MobFoxPlugin object is the same between calls (at 0x1550f030 in the above logs) but the CustomEvent objects (MobFoxCustomEventConversant in the above logs) are newly-allocated every time.
Andre
Hi Andre, Just wanted to let you know that we have found what's causing this issue and that it will have a fix on our next release.
Thank you for your patience. Best, -Shahaf
That's good news, thanks!
Is this fix included in the 3.3.1 release?
Hi,
No, 3.3.1 is bug fix for a crash that was reported on some creatives (not pertaining to the classes you are using). The fix for this issue is part of our regular release schedule, planned for next week or, if testing goes slowly, the week after. The relevant code is already committed.
Thanks, Itamar
fixed in 3.3.3
That's great, thanks. I'll take a look soon.
Is a fix for the same issue coming soon to the Android SDK as well?
Yes, it is, but it's more complex for Android so it will take a few ore weeks
Issue
A separate WebView is created for every banner ad request made through the CustomEvent interface, and previous banners are never deallocated. This results in a significant resource leakage.
All of your example code in this repository for CustomEvent integrations shows the allocation of a new native banner object for the appropriate SDK whenever
-requestAdWithSize
is called. This could easily be fixed by only creating a new instance of the appropriate native banner object if one has not already been created.Unfortunately, it appears that this function is always invoked on a new instance of the CustomEvent adapter object, and old adapters are never deallocated. This prevents the suggested fix above from being effective.
This issue occurs whether you use
MobFoxAd
'srefresh
member to refresh the ads, or you call-loadAd
on your own app-driven schedule.See log below (looking carefully at the logged values for
self
. Conversant is used as an example here, but it applies to all CustomEvent adapters. I can also confirm via logging that the adapter object's-dealloc
method is never called.The end result is an ever-growing stack of web views, one for each ad request. This can be seen using Safari (or Chrome, on Android) dev tools:
Expected Behavior
Use Case
Our app is a single-page hybrid app with a refreshing banner at the the bottom of the page. It is always in view, and we want it to refresh every so often. The app is intended to run for extended periods of time while the users play a physical card game.