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

323
Views
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
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!