0 Favourites

How do I check if the device is connected to internet

  • Hi,

    My game have interstitial ads that is shown in a specific moment of the game. But if the device is not connected to the internet the interstitial ads won't show. I would like to make sure that the device is connected to the internet, so it can load and show the interstitial ads. When there is no internet connection the game hangs trying to show the interstital. Is there a way to check if the device is connected? And if the device its not connected, is there a way to skip the interstitital and proceed with the game, without hanging? Thanks!

  • If you could let me know what device you are referring to, a browser, a phone or such it would be alot easier.

    With the browser object theres a 'is offline' action

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Hi,

    My game have interstitial ads that is shown in a specific moment of the game. But if the device is not connected to the internet the interstitial ads won't show. I would like to make sure that the device is connected to the internet, so it can load and show the interstitial ads. When there is no internet connection the game hangs trying to show the interstital. Is there a way to check if the device is connected? And if the device its not connected, is there a way to skip the interstitital and proceed with the game, without hanging? Thanks!

    As covered in the Browser section of the manual:

    If you have the Browser object in your project you can use the condition

    Is online
    True if the browser currently has an active connection to the internet. [/code:d74auqgi]
    
    You could also try the expression
    [code:d74auqgi]ConnectionType
    The type of connection technology in use if it is known. This can be "bluetooth", "cellular", "ethernet", "wifi", "wimax", "other", "unknown" or "none" (indicating offline mode).[/code:d74auqgi]
  • Alydus,

    Thanks and sorry, it is for mobile phones, tablets and desktop.

    zenox98,

    Thank you too. How can i use this ConnectionType, i can't see this on browser actions or conditions?

    I really appreciated your help. I will use a browser event.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)