Reputation: 61
I'm using this Admob plugin for Phonegap running on iOS like this:
window.plugins.AdMob.createBanner({"siteId":"my-site-id"});
window.plugins.AdMob.loadBanner();
// move banner to make it appear
window.plugins.AdMob.moveBanner({"positionX":0,"positionY":410});
And it's actually working. The problem is that this is causing my app to consume a lot memory, and the app to crush when on a device according to the Apple crash report I got from iTunesConnect.
Can you help me in understanding how to use this plugin?
Thanks!
Upvotes: 0
Views: 1870
Reputation: 2281
Are you using the deletBanner: method anywhere? I think there may be a memory leak there possibly. The plugin looks like it removes the adBanner property from its superview and nil's it out, but I think it may need to also:
delegate
for adBanner
to nil
adBanner
(you can double-check this by seeing what the retain count of the adBanner
is). I think UIViewController's dealloc
automatically calls removeFromSuperView
: but deleteBanner
: probably wouldn't do that?Upvotes: 1