Open thisandagain opened 9 years ago
So, when you mentioned Webview is that the default browser app from Android on Kitkat correct? The reason I asked here is that it might not be possible to solve this using our current Websocket
impl, but I believe if anyone using Chrome or Firefox browser app will be able to run MakeDrive with Websocket no problem.
@thisandagain can you comment on the conversation we had about socket.io
and sockjs
again? I can't recall about this.
In Android prior to version 4.4, Websockets are not supported in either the Webview class or in the default browser that ships with the OS. Because of this, we'll want to look at using a library that provides a polyfill. I've worked with a bunch of these in the past (like socket.io and sockjs) but don't have any strong recommendations particularly given that socket.io was just recently redesigned.
One thing that we might want to look at is Primus which isn't a websocket polyfill / library per-se as much as it is an abstraction to help prevent against lock-in. This could be particularly helpful with testing!
See: https://medium.com/@denizozger/finding-the-right-node-js-websocket-implementation-b63bfca0539
Interesting discussion of socket.io + FFOS 2.0 + Flame https://groups.google.com/forum/#!topic/mozilla.dev.platform/X7fGhVL_NrI
Within webviews on Android < 4.4 we hit an issue with makedrive in that WebSockets are not supported. Specifically, we get a fatal exception on line 10 of
client-ws.js
:I realize that it may not be possible to resolve this in its entirety, but it could be helpful to have makedrive return an error to the client for handling vs. throwing when
WebSocket
is undefined.