Open varghesethomase opened 9 years ago
Please leave a more helpful bug report. What phones does it not work on? Which parts do not work? Are there any JavaScript errors?
Websockets do not work on many old phones anw, have you tried plain web-sockets(without this library)?
If plain web-sockets don't work use this:https://github.com/knowledgecode/WebSocket-for-Android (I suggest closing this issue as android versions less than kitkat do not support web-sockets unless they have a custom factory default browser that does so, other than that the above library solves the issue)
I have the same issue. var ws = new WebSocket(WEBSOCKETURL); works for me on android 4.2
what's the issue? if new WebSocket(WEBSOCKETURL)works, new ReconnectingWebSocket should work. Do you get any error? for me it worked fine the only trick i had to do was to close the socket manually before unload in order to avoid crashes(I was also using https://github.com/knowledgecode/WebSocket-for-Android)
A bit late but i had the same issue and found out that on Ios 5.1.1 (hixie-76) the use of the second argument (protocols) triggers two errors:
Wrong protocol for WebSocket ''
and
_SYNTAXERR: DOM Exception 12
May be related: https://bugs.webkit.org/show_bug.cgi?id=46942
In my case the solution was changing the line
ws = new WebSocket(self.url, protocols || []);
to
if (protocols) { ws = new WebSocket(self.url, protocols); } else { ws = new WebSocket(self.url); }
Works also in current versions of Firefox, Chrome and Safari also mobile versions.
HTH
I tried using this plugin in cordova app. It works in new web views when running in new android phones( kitkat and above ) but found that it does't work in many old phones.