cabal-mobile icon indicating copy to clipboard operation
cabal-mobile copied to clipboard

iOS support + android utp-native support (hole punching)

Open jimpick opened this issue 7 years ago • 7 comments

I've been working with mafintosh to get support for cross-compiled native modules working.

With these patches, it should be possible to use the app on an iOS device (64-bit only).

The native modules are in the following extra npm packages:

  • https://www.npmjs.com/package/sodium-native-prebuilds-nodejs-mobile
  • https://www.npmjs.com/package/utp-native-prebuilds-nodejs-mobile

I haven't built x86_64 versions (which the iOS emulator would use).

It should also be possible to build native modules for Android ... the utp-native package in particular will help in making connections from behind firewalls.

jimpick avatar Jun 25 '18 08:06 jimpick

Looks good! I could try running this PR on my macOS (not my main computer), but I'd rather just merge, trusting that it's right.

staltz avatar Jun 25 '18 08:06 staltz

I can try to run it on my mac if you want

vesparny avatar Jun 25 '18 08:06 vesparny

@jimpick I'm running the branch on a 6+. I think i saw my user join for a moment in the users list in the cli, but it's hanging at loading the channels and never finishes. I'm getting a Connection has no connected handler error in the log... not sure if that's related.

nikolaiwarner avatar Jun 25 '18 14:06 nikolaiwarner

The "Connection has no connected handler" errors are a React Native thing - I believe they are unrelated. I couldn't get them to go away during development.

https://github.com/facebook/react-native/issues/10027

I noticed that the channels take a very long time to long on the first attempt. You might have to restart the app several times. It might work better if you create a clean cabal dat and try to connect to that. I know that HyperDB has some replication issues that might also be causing havoc (when I get time, I plan to try to get a test case for that).

In the longer run, I think all of these peer-to-peer apps will need to show a bit more feedback in the UI with progress indicators, propagation feedback, swarm health, etc.

jimpick avatar Jun 26 '18 05:06 jimpick

I just added x86_64 (aka x64) prebuilds for the iOS simulator, so it should work there.

I can get it to work if I start a new cabal ... cabal --db ./db

I haven't been able to get it to sync to the public cabal at dat://59813e3169b4b2a6d3741b077f80cce014d84d67b4a8f9fa4c19605b5cff637f ... i think it might have too much history. It might be hitting some hyperdb bugs.

jimpick avatar Jul 01 '18 06:07 jimpick

I made some android prebuilds for utp-native as well. With utp support, Android should be able to do "hole punching" in certain behind-the-firewall situations.

jimpick avatar Jul 02 '18 05:07 jimpick

I was able to run this in the iOS simulator on my macbook, nice work @jimpick!

wittjosiah avatar Aug 08 '18 23:08 wittjosiah