jxcore/jxcore-cordova

Using socketio (removing node_modules) from app?

frankandrobot opened this issue · 4 comments

I'm trying to use socketio. In order for it to work on the Desktop, you have to remove the socketio node_module from the executable and then add a preInstall command to jx install it, the first time the app runs. See jxcore/jxcore#101

How can I achieve the same thing with Android?

Let me repeat same answer from jxcore/jxcore#101 :)

@frankandrobot If I understand you well, you're going to use on android .node addons compiled on some other platform? This cannot work, i guess.

My point is, that you're going to install socketio on your desktop computer. During this step .node files (native addons) will be compiled for that specific platform. Now when cordova will pack the application it will transfer .node files to the mobile device, but they cannot work there. App wil start but sooner or later may crash.

So conclusion is that you will not be able to run socketio with jxcore-cordova plugin (or any other module using native addons). Please correct me anyone if I'm wrong?

So how the heck is express running in the demo?

If what you're saying is correct, then this is a huge deal breaker.

If you look at the sample/express_sample/www/jxcore/package.json dependencies, you'll find express 4.12.3. This version doesn't seem to use any socketio module. I don't know about other versions of express though.

@frankandrobot If you're looking for websocket server-client implementation, you may take a look at https://github.com/jxcore/jxm . It does work with jxcore-cordova