How to use Admob Phonegap plugin with iOS

邮差的信 提交于 2019-12-13 06:18:13

问题


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!


回答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?


来源:https://stackoverflow.com/questions/10675978/how-to-use-admob-phonegap-plugin-with-ios

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!