0

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!

Efi Debi
  • 61
  • 2
  • 12
  • Do you know where your app is consuming a lot of memory? Do you have any of the crash reports and/or stack traces to show us? These would help in identifying the problem. – RajPara May 21 '12 at 16:45
  • Please see the crash report [here](http://stackoverflow.com/questions/10667385/interpret-apple-crash-report-for#comment13857116_10667385) – Efi Debi May 21 '12 at 21:14
  • How do you figure out the parameters for the AdMob methods? Any reference would be much appreciated, thank! – blurrcat Nov 29 '12 at 08:25

1 Answers1

1

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:

  • Set the delegate for adBanner to nil
  • Release the 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?
RajPara
  • 2,281
  • 1
  • 16
  • 9
  • I believe you are right, and the correct usage might be like this `// First delete banner if exsist in any of the html pages window.plugins.AdMob.deleteBanner(); 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});` What do you think? – Efi Debi May 24 '12 at 08:30
  • OK, so using the `deleteBanner` method as is didn't work, the app continued to crush at startup. I now added this `self.adBanner.delegate = nil; [self.adBanner release];` to AdMobController.m. Hopefully it will work, – Efi Debi May 25 '12 at 15:41