Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

432
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda