"Browser --> Is Online" not working properly on Android App

Not favoritedFavorited Favorited 0 favourites
  • 5 posts
From the Asset Store
ALL Firebase Support c3 export > WEB > MOBILE > DESKTOP
  • Hi.

    I am testing every X seconds if there is internet connection in a game of mine.

    Event: Every 5 seconds

    Sub-event: Browser is not online --> Create Object.

    When I am testing this on my phone, using the Remote preview, it works fine. It detects when the internet connection goes on or off.

    If I export it for Android and open the app in my phone the event behaves weird:

    If I have wi-fi enabled before I open the app, it will remember this action even if I enable/disable de wi-fi after that while the app is open and the other way around.

    Is there any other way to check for internet connection in an app?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi. This is a feature of the platform. Even using native methods of polling the state of the internet connection, the answer will not always be 100% accurate.

    If you really want to find out exactly, you need to contact any source on the network, it can be anything, such as your own or public website or some service. After contacting, if there is no answer, then there is no network.

  • Hi. This is a feature of the platform. Even using native methods of polling the state of the internet connection, the answer will not always be 100% accurate.

    If you really want to find out exactly, you need to contact any source on the network, it can be anything, such as your own or public website or some service. After contacting, if there is no answer, then there is no network.

    Can you post a screenshot example of how to do this?

  • See the note in the manual:

    The "is online" detection of the Browser plugin is more or less a guess. It is actually difficult to categorically determine if an Internet connection is available. For example the user may have intermittent signal, and online features sometimes work and sometimes fail unpredictably. In this case the "Is online" detection is probably wrong, as it can't actually tell whether a connection will work. Rather than using this condition to check if online features will work, usually it's better to just go ahead and use online features anyway as if the user is online, and handle any errors that occur as a result.

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