tasq/node_modules/gun/examples/react-native
2026-04-09 19:01:53 +08:00
..
android added ruflo 2026-04-09 19:01:53 +08:00
ios added ruflo 2026-04-09 19:01:53 +08:00
src added ruflo 2026-04-09 19:01:53 +08:00
.babelrc added ruflo 2026-04-09 19:01:53 +08:00
.buckconfig added ruflo 2026-04-09 19:01:53 +08:00
.flowconfig added ruflo 2026-04-09 19:01:53 +08:00
.gitattributes added ruflo 2026-04-09 19:01:53 +08:00
.watchmanconfig added ruflo 2026-04-09 19:01:53 +08:00
app.json added ruflo 2026-04-09 19:01:53 +08:00
index.js added ruflo 2026-04-09 19:01:53 +08:00
package.json added ruflo 2026-04-09 19:01:53 +08:00
README.md added ruflo 2026-04-09 19:01:53 +08:00
shim.js added ruflo 2026-04-09 19:01:53 +08:00

Gun on react-native!


running the demo

  1. do yarn install on the directory of the demo examples/react-native
  2. run the demo with react-native run-ios or react-native run-android

debugging

i would recommend using react-native-debugger but you can use chrome's debugger as well

  • ios: cmd+D then Debug JS Remotely
  • android: cmd+M then Debug JS Remotely

now you have access to the gun globals on the console which are gun -> the root gun user -> the gun user

how it all of this is done

since react-native doesnt provide the crypto module that we desire the most and all of the packages are incompatible with react-native/sea, and so to get sea.js working we use a webview(react-native browser) and bridge the crypto module from that browser to the global window and thats exactly what webview-crypto does, thanks to webview-crypto repo, the webview-crypto provided in this repo is somewhat the same but modified to get it working and mostly compatible with sea/react-native (even though there is a polyfiller for that but it just doesnt work ;/).