cabal-club / cabal-mobile

p2p chat in your phone [dev help wanted :)]
Other
145 stars 16 forks source link

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

Open jimpick opened 6 years ago

jimpick commented 6 years ago

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:

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.

staltz commented 6 years ago

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.

vesparny commented 6 years ago

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

nikolaiwarner commented 6 years ago

@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.

jimpick commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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.

wittjosiah commented 6 years ago

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