Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

434
Views
Is there a way I can detect internet connection with Firebase in Unity?

I am working on a mobile game, where I would like to know if the player has internet connection or not. I tried doing it with the following methods:

  • Unity's internetReachability property, but it doesn't work, since - as they wrote out in the docs too - it doesn't actually detect if the player has internet connection
  • Pinging a website that is on 24/7 (e.g Google), but it is bad since if there are thousands of users, it will load Google servers
  • Now I'm trying to get a result by retrieving data from my Firebase database every X secs, and if it doesn't load, there is no connetction: the problem is, even if there is no internet connection, it doesn't crash/give any error

Is there a way I can achieve what I want with Firebase?

Please note that if the player has no internet connection, they should not be able to click on any of the game functions, because it will cause bugs, so I would like to check for connection continuously. When there is no connection I disable the GUI so that the player can not cause bugs)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If you're using the Firebase Realtime Database, it has a built-in mechanism to show you when the app is connected to the database servers. By listening to the .info/connected node, you can detect this state and update your UI.

Note that this is not just detecting an internet connection, but whether the app is connected to the database backend. So in cases where the user may have an internet connection, but can't connect to the database backend, the flag may be false.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!