Menu

I built a P2P disappearing-message app with React Native and WebRTC. Here's what was harder than expected
📰

I built a P2P disappearing-message app with React Native and WebRTC. Here's what was harder than expected

DEV Community: reactnative·Jin Xu·12 days ago
#oeom3au3
#devtoreactnative#devto#dev#message#phone
Reading 0:00
15s threshold

Most "private" messengers still ask for your phone number. I wanted something closer to passing a note: share a short code with someone you already know, talk, and when you're done there's nothing left on either phone.

That became IncogSnap , an Android app (iOS coming) built with Expo / React Native. You create a room, get a 6-digit code (or a QR / link), your friend types it in, and the two phones talk directly over WebRTC. No account, no phone number, no email.

This post is about the parts that turned out harder than they looked.

The stack

Expo SDK 57 / React Native 0.86

react-native-webrtc for the peer connection and DataChannel

tweetnacl for crypto

Firebase Realtime Database for signaling only (exchanging SDP offers/answers and ICE candidates)

expo-screen-capture to block screenshots and screen recording

1. "Peer-to-peer" doesn't connect on its own

My first version used public STUN servers only. On the same Wi-Fi it worked every time.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.