Skip to content

Boilerplate React-native (Expo) Demo App

Source code

This is React Native (Expo) demo app for the Ethereum Comments Protocol.

It is very similar to the react demo app, but built with a React Native tech stack.

  • Custom commenting UI
  • Wallet integration via Reown AppKit
  • Post and reply contract interactions via Reown AppKit
  • Infinite scroll using FlatList

Running the app

Prerequisites

  1. Start your local Anvil chain and deploy the protocols to your local chain. Folllow the instruction here.
  2. Configure your wallet app in your phone to use the local chain. In MetaMask, you need to make sure the RPC URL of local chain is accessible from your phone in order to add the custom RPC network.
  3. Follow the instruction in readme to start the indexer and the react demo app, as this demo uses the signing API from the react demo app.

You may want to test the app on your phone because it requires wallet app to post comments:

  1. Install dependencies:

    pnpm install
  2. Create a .env file based on the .env.sample file:

    cp .env.example .env
  3. Update the .env file with your own values.

  4. Run the app:

    pnpm run ios

    alternatively, run the app as development build:

    pnpm run dev:ios
  5. Scan the QR code from the terminal with the Expo Go app on your phone.

Known issues:

  • PNPM: Although PNPM team consider that is correct behavior, we experienced a couple times when upgrading libs (totally unrelated to wagmi, such as react-native-async-storage) in this repo, causing a duplicated wagmi package gets referenced by sdk and shared packages, this cause build issues for the other apps in the monorepo. We've tried solution from this issue but none of them permanently fixed the issue, we should consider writing a custom script to force linking the packages into the same folder.
  • AppKit: For error message about "_reactNative.BackHandler.removeEventListener is not a function (it is undefined)", please see: https://github.com/reown-com/appkit-react-native/issues/339