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

321
Vistas
socket.io with phonegap build on android does not work

I've have an html5/javascript app that uses socket.io and it works just fine on the browser but when compile in Phonegap Build for Android socket.io does not connect when executing socket = io.connect([server]:[port]).

I've already tried a lot of possible solutions, none of them worked out. This is what I've tried already:

  • using IP instead of full domain when connecting to socket.io
  • socket.io connection done after ondeviceready event is triggered
  • plugin cordova-plugin-whitelist in config.xml
  • plugin https://github.com/mkuklis/phonegap-websocket in config.xml
  • tried to use cordova-plugin-crosswalk-webview in config.xml but Phonegap Build just does not go through with the compilation process and throws an error
  • access origin="*" in config.xml
  • io.set('origins', ':') in server code
  • different socket.io transports (websockets, polling, etc)

I am using Phonegap's latest version 6.5.0 (Phonegap Build does not allow me to use a previous version like 6.4.5).

Whatever I do socket.on("connect", function() { alert(socket.id) }) is never triggered on Android. On web, however, it alerts with the proper socket.id.

Also, I tried to check out log with DEBUG=* node server.js and nothing appears when using Android version.

over 4 years ago · Santiago Trujillo
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