Description
In the browser, we don't have access to TCP Sockets as we do with nodejs. However, when in cordova/phonegap environment, you have access to a webview for running JS but also a plugin architecture, where you can expose native functionality as a JS API. Hence, there could be a transport written for cordova/phonegap in Android/iOS that enables us to have a nodejs-like js-ipfs instance in a webview.
This would help with developing mobile applications for JS developers.
There are some prior art with this as well, https://www.npmjs.com/package/cordova-plugin-chrome-apps-sockets-tcp comes from Google and exposes a sockets API whose interface can be seen here: https://developer.chrome.com/apps/sockets_tcp
There is also https://github.com/blocshop/sockets-for-cordova
Ideally, the interface exposed by the plugin would be identical to the nodejs interface for sockets, and then https://github.com/libp2p/js-libp2p-tcp could be easily adapted to work.
Existing, similar issues:
- Daemon on Cordova - Android - Runtime Support: Cordova ipfs/js-ipfs#834
ipfs.files.add
callbacks and promises do not resolve on Ionic2 platform - Runtime Support: Ionic Framework ipfs/js-ipfs#802