CoronaProvider.ads.vungle.isAdAvailable()

Just to be clear as in the docs you can find all 4 syntax:

  1. CoronaProvider.ads.vungle.isAdAvailable()

  2. ads.vungle.isAdAvailable()

  3. vungle.isAdAvailable()

  4. ads.isAdAvailable()

Which one is right ?

To answer myself :slight_smile:

It works for me with:

ads.isAdAvailable()

Regards,

Damir.

Actually, I am not so sure about this.

Can anyone confirm this ?

Hey, Damir @ubj3d.android, I just checked mine, and I use:

CoronaProvider.ads.vungle.isAdAvailable()

I’m puzzled to hear other ones can also work…?

Naomi

Hey guys,

I am using  ads.isAdAvailable() but like Naomi, I am surprise why all the other ones?

Thanks.

Mo

I just tried the iOS version of my app, and CoronaProvider.ads.vungle.isAdAvailable() does not work (resulting in runtime error.)  It’s been working perfectly fine on Android device though.  Ugh, what’s going on here.  Since I use single code base, this bothers me.  Do I need to use different function call for each?

Naomi

Edit:  Hmmm… I just looked at the API doc:  http://docs.coronalabs.com/daily/plugin/vungle/isAdAvailable.html

It looks like we are supposed to use ads.isAdAvailable() instead?

But then, why does CoronaProvider.ads.vungle.isAdAvailable() work on Android but not iOS?  Rather confusing.

I’d so appreciate it if someone can confirm ads.isAdAvailable works fine with Android version (and I’d update the code to use this function instead of doing if-else statement for each device OS.)

I think the confusion/problems comes from the API doc:  http://docs.coronalabs.com/daily/plugin/vungle/isAdAvailable.html

Where the API is entitled as CoronaProvider.ads.vungle.isAdAvailable()

However, Syntax says its:  vungle.isAdAvailable()

And then, the example says its:  ads.isAdAvailable()

I changed mine to ads.isAdAvailable() for iOS build, and it works there.  (I’m not ready to re-set my project for Android version, so I would have to test if ads.isAdAvailable() works there…)

Naomi

P.S.,  I added a comment on API page so that Corona Team is aware of this (and hopefully, the API doc page will be updated so that we know exactly what syntax we are expected to use…)

To answer myself :slight_smile:

It works for me with:

ads.isAdAvailable()

Regards,

Damir.

Actually, I am not so sure about this.

Can anyone confirm this ?

Hey, Damir @ubj3d.android, I just checked mine, and I use:

CoronaProvider.ads.vungle.isAdAvailable()

I’m puzzled to hear other ones can also work…?

Naomi

Hey guys,

I am using  ads.isAdAvailable() but like Naomi, I am surprise why all the other ones?

Thanks.

Mo

I was using  ads.isAdAvailable() and it worked great on iOS but not for Android

I tried all of the following but I cannot get anything to work on Andoid

  1. CoronaProvider.ads.vungle.isAdAvailable()

  2. ads.vungle.isAdAvailable()

3) vungle.isAdAvailable()

  1. ads.isAdAvailable()

 

Here is my code: it always says ads are available, even when they are not

 local function listener( event )

   

        

    if CoronaProvider.ads.vungle.isAdAvailable() then

            statusText.text = “ADS are available”

            statusText:setTextColor (113, 255, 103 )

            else

            statusText.text = “ADS are NOT available”

            statusText:setTextColor ( 255, 49, 95 )

    end

end

timer.performWithDelay( 1000, listener,0 )

it stinks because it works so nicely on iOS I would love to be able to use this on android

Thank you for any help on this issue 

Oh Btw ads.isAdAvailable() is the one that worked for me on iOS

Just to confirm that ads.isAdAvailable() is working fine on both iOS and Android build for me.  (I finally got around to testing both.)

Naomi

I just tried the iOS version of my app, and CoronaProvider.ads.vungle.isAdAvailable() does not work (resulting in runtime error.)  It’s been working perfectly fine on Android device though.  Ugh, what’s going on here.  Since I use single code base, this bothers me.  Do I need to use different function call for each?

Naomi

Edit:  Hmmm… I just looked at the API doc:  http://docs.coronalabs.com/daily/plugin/vungle/isAdAvailable.html

It looks like we are supposed to use ads.isAdAvailable() instead?

But then, why does CoronaProvider.ads.vungle.isAdAvailable() work on Android but not iOS?  Rather confusing.

I’d so appreciate it if someone can confirm ads.isAdAvailable works fine with Android version (and I’d update the code to use this function instead of doing if-else statement for each device OS.)

I think the confusion/problems comes from the API doc:  http://docs.coronalabs.com/daily/plugin/vungle/isAdAvailable.html

Where the API is entitled as CoronaProvider.ads.vungle.isAdAvailable()

However, Syntax says its:  vungle.isAdAvailable()

And then, the example says its:  ads.isAdAvailable()

I changed mine to ads.isAdAvailable() for iOS build, and it works there.  (I’m not ready to re-set my project for Android version, so I would have to test if ads.isAdAvailable() works there…)

Naomi

P.S.,  I added a comment on API page so that Corona Team is aware of this (and hopefully, the API doc page will be updated so that we know exactly what syntax we are expected to use…)

I can’t seem to get ads.isAdAvailable() to work on even iOS. I stripped out my code so it just inits vungle and then checks this, but it still doesn’t work.

I get a Runtime error “attempt to call field isAdAvailable() (a nil value)”. What daily build are you all using? Im on 1157.

@naveen_pcs, I was able to use CoronaProvider.ads.vungle.isAdAvailable() for Android device with Daily Build 1179.  And ads.isAdAvailable() worked for me on both iOS and Android devices.

Naomi

@navveen_pcs 

You have to build for the device or Xcode simulator to test the ads. you will get that error in the corona simulator

Awesome, this worked! Thanks!