Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UnityAds

Discussion in 'Unity Ads & User Acquisition' started by Triggles, Sep 7, 2014.

  1. Triggles

    Triggles

    Joined:
    Aug 23, 2014
    Posts:
    30
    I recently added UnityAds to my game using the plugin, in Android. It all works great, except for in a strange edge case. If I:

    - Start my game WITH an internet connection
    - Go to a section of the game which allows me to request a video ad (by this time, it's checked ads are available)
    - Turn off the internet connection
    - Try to request an ad

    At this point, it just sits there, then when I tap on the screen to do anything, the game essentially freezes (I think it's still running, but it refuses to accept input). Checking logcat suggests it tries to get to the ad server, then fails and dies.

    I call Advertisment.IsReady() before requesting an ad, and I've even tried re-initializing it in the hope that it would fail, but it still attemps to get an ad.

    I don't really want to have to check for internet connectivity every time I request an ad - I'd assumed UnityAds would do this itself.

    Any ideas?

    Thanks

    P.S. I added "if(Application.internetReachability == NetworkReachability.NotReachable) return;" before I request an ad, but as I understand it this will still pass if the phone is connected to a network with no internet access. Still, that's a real edge case there, so it might be enough.
     
    Last edited: Sep 7, 2014
    unity-nikkolai likes this.
  2. HeikkiTunkelo

    HeikkiTunkelo

    Unity Technologies

    Joined:
    May 13, 2014
    Posts:
    104
    Hi Triggles,

    Thanks for exploring edges ;)

    I've added what you have described to our bug/support tracker, the system definitely should not freeze or crash your game in any circumstances.

    Cheers,
    Heikki
     
  3. Triggles

    Triggles

    Joined:
    Aug 23, 2014
    Posts:
    30
    Thanks Heikki!

    If anyone needs a sample program to reproduce it, please do not hesitate to ask.

    P.S. This was with Unity 4.6 beta - I hope that wasn't related.
     
  4. HeikkiTunkelo

    HeikkiTunkelo

    Unity Technologies

    Joined:
    May 13, 2014
    Posts:
    104
    Hi Triggles,

    Just to let you know: We reproduced the problem you reported and have made a fix for it. It will be available in our next asset-store update.

    Cheers,
    Heikki
     
  5. Triggles

    Triggles

    Joined:
    Aug 23, 2014
    Posts:
    30
    Wow, that is fantastic news! Thanks guys!
     
  6. needhamca

    needhamca

    Joined:
    Jul 27, 2014
    Posts:
    9
    awesome!
     
  7. henkui

    henkui

    Joined:
    May 30, 2013
    Posts:
    1
    Great that a fix is on it's way but are there any estimates on when the next update with the fix might be available?
     
  8. HeikkiTunkelo

    HeikkiTunkelo

    Unity Technologies

    Joined:
    May 13, 2014
    Posts:
    104
    Hi Henkui,

    We are still testing it. But I would expect it to ready to go out within a week.

    Cheers,
    Heikki