How do I check if the device is connected to internet

0 favourites
  • 3 posts
From the Asset Store
A futuristic device, can be used as radarscreen, optionscreen, infodisplay, research device, ...
  • 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!

  • 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]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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)