diff --git a/example/.gitignore b/example/.gitignore index 772ef297e..7cdd9d463 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -15,3 +15,6 @@ web-build/ # Temporary files created by Metro to check the health of the file watcher .metro-health-check* + +# Environment settings +.env diff --git a/example/App.tsx b/example/App.tsx index db19e6ffe..51f2641b9 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -9,24 +9,28 @@ import HomeScreen from './src/HomeScreen' import LaunchScreen from './src/LaunchScreen' import { Navigator } from './src/Navigation' import TestScreen from './src/TestScreen' -import { ThirdwebProvider, walletConnect } from "@thirdweb-dev/react-native"; +import { ThirdwebProvider, metamaskWallet, rainbowWallet } from "@thirdweb-dev/react-native" +import { Ethereum } from "@thirdweb-dev/chains" +import Config from 'react-native-config' const queryClient = new QueryClient() + export default function App() { + // Uncomment below to ensure correct id loaded from .env + // console.log("Thirdweb client id: " + Config.THIRD_WEB_CLIENT_ID) return ( "} + activeChain={ Ethereum } + supportedChains={ [ Ethereum ] } + clientId={ Config.THIRD_WEB_CLIENT_ID } dAppMeta={{ name: "XMTP Example", - description: "This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with.", + description: "Example app from xmtp-react-native repo", logoUrl: "https://pbs.twimg.com/profile_images/1668323456935510016/2c_Ue8dF_400x400.jpg", url: "https://xmtp.org", }} supportedWallets={[ - walletConnect({ - recommended: true, - }) + metamaskWallet(), rainbowWallet() ]}> diff --git a/example/EXAMPLE.env b/example/EXAMPLE.env new file mode 100644 index 000000000..0471849f7 --- /dev/null +++ b/example/EXAMPLE.env @@ -0,0 +1 @@ +THIRD_WEB_CLIENT_ID="INSERT_CLIENT_ID_HERE" \ No newline at end of file diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 360c9e2f6..4ea297aa1 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -315,6 +315,10 @@ PODS: - glog - react-native-blob-util (0.19.6): - React-Core + - react-native-config (1.5.1): + - react-native-config/App (= 1.5.1) + - react-native-config/App (1.5.1): + - React-Core - react-native-encrypted-storage (4.0.3): - React-Core - react-native-get-random-values (1.10.0): @@ -489,6 +493,7 @@ DEPENDENCIES: - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) - React-logger (from `../node_modules/react-native/ReactCommon/logger`) - react-native-blob-util (from `../node_modules/react-native-blob-util`) + - react-native-config (from `../node_modules/react-native-config`) - react-native-encrypted-storage (from `../node_modules/react-native-encrypted-storage`) - react-native-get-random-values (from `../node_modules/react-native-get-random-values`) - react-native-mmkv (from `../node_modules/react-native-mmkv`) @@ -607,6 +612,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/logger" react-native-blob-util: :path: "../node_modules/react-native-blob-util" + react-native-config: + :path: "../node_modules/react-native-config" react-native-encrypted-storage: :path: "../node_modules/react-native-encrypted-storage" react-native-get-random-values: @@ -708,6 +715,7 @@ SPEC CHECKSUMS: React-jsinspector: 7bf923954b4e035f494b01ac16633963412660d7 React-logger: 655ff5db8bd922acfbe76a4983ffab048916343e react-native-blob-util: d8fa1a7f726867907a8e43163fdd8b441d4489ea + react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8 react-native-encrypted-storage: db300a3f2f0aba1e818417c1c0a6be549038deb7 react-native-get-random-values: 384787fd76976f5aec9465aff6fa9e9129af1e74 react-native-mmkv: e97c0c79403fb94577e5d902ab1ebd42b0715b43 @@ -735,20 +743,11 @@ SPEC CHECKSUMS: secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634 SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1 web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959 -<<<<<<< HEAD - XMTP: dc02c96b475e326a4a7b3d3912cc45cf3527bd0b - XMTPReactNative: f4acdf29845869a324d9b99e2021c7050f227d99 - XMTPRust: 8848a2ba761b2c961d666632f2ad27d1082faa93 - Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9 - -PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2 -======= XMTP: aa137f3c8ac7b61ecfb3de0973f2dc2e672a9ec1 XMTPReactNative: e4a325b0b51dedf1a2785cad53ca3bceb1149b86 XMTPRust: 8848a2ba761b2c961d666632f2ad27d1082faa93 Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9 -PODFILE CHECKSUM: bf49a4bdc3d11b67c441720989a50fa1e6be21f3 ->>>>>>> main +PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2 COCOAPODS: 1.14.3 diff --git a/example/package.json b/example/package.json index 8b402ee5b..a2b4c2db5 100644 --- a/example/package.json +++ b/example/package.json @@ -26,6 +26,7 @@ "react": "18.2.0", "react-native": "0.71.14", "react-native-blob-util": "^0.19.0", + "react-native-config": "^1.5.1", "react-native-crypto": "^2.2.0", "react-native-encrypted-storage": "^4.0.3", "react-native-get-random-values": "^1.10.0", diff --git a/example/src/types/react-native-config.d.ts b/example/src/types/react-native-config.d.ts new file mode 100644 index 000000000..19491e5ea --- /dev/null +++ b/example/src/types/react-native-config.d.ts @@ -0,0 +1,8 @@ +declare module 'react-native-config' { + export interface NativeConfig { + THIRD_WEB_CLIENT_ID?: string; + } + + export const Config: NativeConfig + export default Config + } \ No newline at end of file diff --git a/example/yarn.lock b/example/yarn.lock index 6ed1ebb68..765def3de 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -13367,6 +13367,11 @@ react-native-codegen@^0.71.6: jscodeshift "^0.14.0" nullthrows "^1.1.1" +react-native-config@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/react-native-config/-/react-native-config-1.5.1.tgz#73c94f511493e9b7ff9350cdf351d203a1b05acc" + integrity sha512-g1xNgt1tV95FCX+iWz6YJonxXkQX0GdD3fB8xQtR1GUBEqweB9zMROW77gi2TygmYmUkBI7LU4pES+zcTyK4HA== + react-native-crypto@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/react-native-crypto/-/react-native-crypto-2.2.0.tgz#c999ed7c96064f830e1f958687f53d0c44025770"