mcw
mcw

Reputation: 545

Sending data device-to-device, Android or iOS agnostic with React Native

My use case is I want to enable two devices, Android or iOS (between them, or among them), to discover each other and exchange a small amount of data when in close proximity. I'm building the app with React Native.

I've looked into a number of different libraries for this, using BLE and Wifi P2P/Multipeer, but everything I've found either a) explicitly doesn't work with device-to-device data transfer or b) only works with Android-Android or iOS-iOS.

Most of the discussions and libraries around this are 2 or more years old, as well, and a lot certainly must have changed.

My basic question is: what's the best way to do this? Is there something I can rely on for cross-platform AND inter-platform direct transfer?

I have been looking into react-native-wifi-p2p, but it notes that for iOS you'll need to create a custom module with multipeer. This is doable, but my concern is still that if I, say, want to do iOS-Android, the Wifi P2P and Multipeer won't be compatible.

I also have investigated react-native-ble-manager, but this seems to focus on discovering and interacting with peripherals: more of a one-way connection than my use case of direct transfer back and forth.

Would love any help from folks with knowledge of the current state of things and if what I'm trying to do is possible.

Thanks!

Upvotes: 0

Views: 437

Answers (0)

Related Questions