0 votes

Currently my workaround is to request ad (AdMob) and see if it fails to load to detect there is no or poor internet. But is there a straight forward easy way of checking internet?

Godot version 3.3
in Engine by (335 points)

1 Answer

0 votes

From what I know, and looking through the docs, there's no API to check internet connection. Your approach is usually what is done to check internet connection.

To make a simpler request you could request https://google.com or https://example.com/ which should always be up.

by (639 points)

To add to this, you can check multiple websites that should always be up (google, amazon, bing) stopping when you get a hit, just in case the user has one of them blocked

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.