TBD: Next step is to prototype the interaction between React Native app back to webview (response to JSON RPC calls). interaction from Webview to reactNative has already been implemented.
npm install (from the root folder)
npx pod-install (from the root folder)
Okay, one more step to get it working on ios. Basically, when installing the pods we got some duplicates and xcode doesn’t like this.
To run:
npm install <package-name>
npx pod-install (from the root folder)
npx react-native start --reset-cache
npx react-native run-ios
To clear the cache: If you are sure the module exists, try these steps:
watchman watch-del-all
run yarn install
yarn start --reset-cache
rm -rf /tmp/metro-*
To close the app:
Shift+Command+H twice to open all apps, swipe up to close the app
Introduction
EIP-1193 EIP-1193 Ethereum Provider Javascript API https://eips.ethereum.org/EIPS/eip-1193 Ethereum Provider API defines the standard on how a dApp interacts with the wallet app through RPC calls using injected content-scripts by setting the window.ethereum object in javascript.
Communication between WebView and ReactNative react-native-webview component has capability for the webview to interact with the react-native app in both directions https://github.com/react-native-webview/react-native-webview/blob/master/docs/Guide.md#communicating-between-js-and-native
Installation Instructions for react-native web3.js web3.js reactive native installation instructions from https://levelup.gitconnected.com/tutorial-how-to-set-up-web3js-1-x-with-react-native-0-6x-2021-467b2e0c94a4
Highlight from the above article Final Step Each time you add a new npm package, you will need to hack the node modules again, to automate this, simply add this to your package.json: "scripts": { ... "postinstall": "./node_modules/.bin/rn-nodeify --install 'crypto,buffer,react-native-randombytes,vm,stream,http,https,os,url,net,fs' --hack" },
Setup Instructions: https://reactnative.dev/docs/next/environment-setup
Note: Once in a while, run the below command to clear the cache.
M1 Specific instruction
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install -- for pod install