Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

CoronaProvider.ads.vungle.isAdAvailable()
Started by ubj3d.android Jul 27 2013 04:25 AM

15 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Contributor

  • 741 posts
  • Corona SDK

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 ?



[TOPIC: post.html]
#2

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Contributor

  • 741 posts
  • Corona SDK

To answer myself :)

 

It works for me with:

 

ads.isAdAvailable()

 

 

Regards,

Damir.



[TOPIC: post.html]
#3

ubj3d.android

[GLOBAL: userInfoPane.html]
ubj3d.android
  • Contributor

  • 741 posts
  • Corona SDK

Actually, I am not so sure about this.

 

Can anyone confirm this ?



[TOPIC: post.html]
#4

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

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



[TOPIC: post.html]
#5

LairdGames

[GLOBAL: userInfoPane.html]
LairdGames
  • Contributor

  • 969 posts
  • Corona SDK

Hey guys,

 

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

 

Thanks.

 

Mo



[TOPIC: post.html]
#6

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

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.)



[TOPIC: post.html]
#7

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

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...)



[TOPIC: post.html]
#8

jimprucey

[GLOBAL: userInfoPane.html]
jimprucey
  • Observer

  • 11 posts
  • Corona SDK

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()

4) 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 


[TOPIC: post.html]
#9

jimprucey

[GLOBAL: userInfoPane.html]
jimprucey
  • Observer

  • 11 posts
  • Corona SDK

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



[TOPIC: post.html]
#10

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

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



[TOPIC: post.html]
#11

naveen_pcs

[GLOBAL: userInfoPane.html]
naveen_pcs
  • Contributor

  • 266 posts
  • Corona SDK

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.



[TOPIC: post.html]
#12

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

@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



[TOPIC: post.html]
#13

jimprucey

[GLOBAL: userInfoPane.html]
jimprucey
  • Observer

  • 11 posts
  • Corona SDK

@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



[TOPIC: post.html]
#14

naveen_pcs

[GLOBAL: userInfoPane.html]
naveen_pcs
  • Contributor

  • 266 posts
  • Corona SDK

@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!



[TOPIC: post.html]
#15

jhsanchez

[GLOBAL: userInfoPane.html]
jhsanchez
  • Observer

  • 19 posts
  • Corona SDK

The both are not working for me, I use Android, can somebody help me please?



[TOPIC: post.html]
#16

jimprucey

[GLOBAL: userInfoPane.html]
jimprucey
  • Observer

  • 11 posts
  • Corona SDK

Are your ads showing?

Did you build it on the device? they will not show in the simulator.

The ads will show without doing this check.

 

I never really got it to work on Android the way it does on iOs. as a boolean that returns true or false.




[topic_controls]
[/topic_controls]