简体   繁体   中英

Unity Ads connection error

I'm having trouble with unity ads, when I open/test my game on an android device that is not connected to an internet, the button to watch an ad will not show and also, when I connect the phone to an internet without closing the game, the button still not gonna show. The only way to show the button is to restart or re-open the game.

What I want to do is when I connect the phone to an internet without closing the game, the button will appear/show. How am I suppose to do that?

You can use this answer for checking is internet connection available: http://answers.unity3d.com/questions/567497/how-to-100-check-internet-availability.html Bellow correct answer you can find more simplified answer from pixel_fiend. Then you could create a timer which is going to call method for checking the internet connection every few.seconds. If method returns false, timer will reset and call the method again after some time. If method returns true then stop the timer. You have internet connection and activate the button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM