using both iad and admob

I have a couple questions related to using both iads and admob.

How do I switch between the two? I’ve seen mention of ads:setCurrentProvider() but do not see this in the documentation.

Does ads.init() need to be called before every ads.show() or just each time I want to switch providers, or only once per provider at the start of my app?

  1. Ads init only needs to be called once.

I typically, do this:

  • Init provider 1
  • Set provider 1
  • Load provider 1
  • Init provider 2
  • … etc.

( Other readers… if you feel this is wrong, wasteful, etc. … please comment.  I do not profess to be an expert re: Ads )

  1. setProvider() Docs… interesting, the docs have changed a little… this looks like it got mis-categorized:

https://docs.coronalabs.com/api/type/CoronaLibrary/setCurrentProvider.html

  1. Once you’ve initialized your providers, simple do a ‘setProvider’ then a show() (or other call) to affect ads from that provider.

Here is a link to some code you can examine for doing the above (not exactly focused on your question, but it should help): https://forums.coronalabs.com/topic/57277-google-admob-test-ads-are-not-showing-up-in-device/

 

See my “07 June 2015 - 09:24 AM” entry in this post.

Cheers,

Ed

Tip:  I know it is tempting to go right to the doc sources sometimes, but you can also go here:

https://docs.coronalabs.com/daily/api/

Then do search on the page for the function/field you need.  You won’t always find it, but most often you will.  

Of course, in this case, it may not have helped much as it is kind of confusing where it is. 

Meanwhile, good luck on your game or app.

Thanks that helped a lot. Have it all working now.

  1. Ads init only needs to be called once.

I typically, do this:

  • Init provider 1
  • Set provider 1
  • Load provider 1
  • Init provider 2
  • … etc.

( Other readers… if you feel this is wrong, wasteful, etc. … please comment.  I do not profess to be an expert re: Ads )

  1. setProvider() Docs… interesting, the docs have changed a little… this looks like it got mis-categorized:

https://docs.coronalabs.com/api/type/CoronaLibrary/setCurrentProvider.html

  1. Once you’ve initialized your providers, simple do a ‘setProvider’ then a show() (or other call) to affect ads from that provider.

Here is a link to some code you can examine for doing the above (not exactly focused on your question, but it should help): https://forums.coronalabs.com/topic/57277-google-admob-test-ads-are-not-showing-up-in-device/

 

See my “07 June 2015 - 09:24 AM” entry in this post.

Cheers,

Ed

Tip:  I know it is tempting to go right to the doc sources sometimes, but you can also go here:

https://docs.coronalabs.com/daily/api/

Then do search on the page for the function/field you need.  You won’t always find it, but most often you will.  

Of course, in this case, it may not have helped much as it is kind of confusing where it is. 

Meanwhile, good luck on your game or app.

Thanks that helped a lot. Have it all working now.