Feat: React Native Showcase App with Cloud Backup - #31
Conversation
claudiovb
left a comment
There was a problem hiding this comment.
Solid showcase overall!
I did a first pass (didn't get to test Google yet, will do on a next run).
From this pass I got minor issues and two problems:
First-time iCloud connect never completes on iOS. The auth hangs after Apple sign-in + 2FA (details in the CloudKitAuthWebView comment).
A fresh clone currently can't build or run and there's four separate causes, each with a fix in the inline comments (the postinstall one is root-caused upstream: tetherto/wdk-worklet-bundler#34).
| "main": "expo-router/entry", | ||
| "description": "Showcase application for WDK (Wallet Development Kit) features in React Native", | ||
| "scripts": { | ||
| "postinstall": "wdk-worklet-bundler generate", |
There was a problem hiding this comment.
On a fresh clone, npm install completes but never generates the worklet bundle: @bitcoinerlab/descriptors (via wdk-wallet-btc) declares @ledgerhq/ledger-bitcoin@^0.3.1 as an optional peer, and the bundler prompts interactively for it this causes the app to fail at runtime with no hint. Root cause is in wdk-worklet-bundler, fixed in tetherto/wdk-worklet-bundler#34:
Verified end-to-end against the fix branch. Fresh install generates the bundle non-interactively and the app runs. No action for now apart from maybe adding ledger-bitcoin dep here so its functional for everyone but once that lands in a release, bump the bundler version here;
| "react-native-screens": "~4.23.0", | ||
| "react-native-svg": "15.15.3", | ||
| "react-native-webview": "13.16.0", | ||
| "react-native-worklet": "^0.0.0", |
There was a problem hiding this comment.
This is an empty npm name-reservation package (no code), looks like a typo alongside react-native-worklets on the next line. Remove
| "react-native-worklet": "^0.0.0", |
| "sonner-native": "^0.21.1", | ||
| "utf-8-validate": "^5.0.10" | ||
| }, | ||
| "devDependencies": { |
There was a problem hiding this comment.
babel.config.js uses babel-preset-expo but it's not declared here... It currently resolves only via hoisting luck from expo's nested copy, and on my install it ended up unresolvable (Metro fails with Cannot find module 'babel-preset-expo'). Please add it to devDependencies pinned to the SDK 55 line (~55.0.23): unpinned installs the SDK 57 preset today, which transforms incompatibly and crashes at startup with ReferenceError: Property 'MessageQueue' doesn't exist.
| dist/ | ||
| ios/ | ||
| android/ | ||
| package-lock.json |
There was a problem hiding this comment.
Please stop ignoring the lockfile and commit it, every other example app in this repo commits one.
It causes many deps issues
| [ | ||
| "expo-build-properties", | ||
| { | ||
| "android": { | ||
| "minSdkVersion": 29 | ||
| } | ||
| } | ||
| ] |
There was a problem hiding this comment.
A clean expo run:ios fails at pod install: AppCheckCore (google-signin) and the SwiftNIO/gRPC-Swift pods (spark) need modular headers. Since ios/ is gitignored and regenerated by prebuild, the fix has to live in config: please add a small Expo config plugin that injects :modular_headers => true for GoogleUtilities, RecaptchaInterop, the CNIO* pods and CGRPCZlib into the Podfile. Note "useFrameworks": "static" is not a viable alternative (I tried and it breaks the app)
| ## Environment Variables | ||
|
|
||
| Create a `.env` file and configure the required values. | ||
|
|
There was a problem hiding this comment.
Missing the opening ``` fence (the closing one is at L136) on GitHub's rendered view the # ── lines display as giant H1 headings.
| │ └── features/ # Self-contained feature modules | ||
| │ ├── wallet/ # Wallet logic (Balance, Transfer, Mgmt) | ||
| │ ├── cloud/ # Cloud backup logic (upload, download, delete, exist, etc) | ||
| │ └── config/ # Configuration viewers |
There was a problem hiding this comment.
This directory doesn't exist in the tree (only features/cloud/ and features/wallet/). Please fix the architecture diagram. Also anything else that might be stale on the readME
| - **UI Smoothness**: Heavy crypto math never blocks the main thread. | ||
| - **Security**: Sensitive key operations are isolated from the main UI context. | ||
|
|
||
| ## 🏁 Getting Started |
There was a problem hiding this comment.
Please add a "copy .env.example → .env and fill providers" step, to guide users on how to build it.
| setTxHash(''); | ||
| try { | ||
| const result = await sendPromise; | ||
| setTxHash(result?.hash); |
There was a problem hiding this comment.
Failed sends are silently swallowed as successes here. The native path (account.send(...), L63) doesn't throw on failure, it resolves with {success: false, error: ...}, so the catch below never runs: this line sets an empty hash, the form clears, and the user thinks the transfer went through. Please check the result and show a toast/alert with result.error when success is false, instead of treating every resolved promise as a success.
| <TouchableOpacity | ||
| style={[styles.sendButton, (!account || isSending) && styles.sendButtonDisabled]} | ||
| onPress={handleSend} | ||
| disabled={!account || isSending} |
There was a problem hiding this comment.
Minor: !account never triggers here (nor the guard at L44), useAccount always returns a truthy proxy, so the button isn't actually disabled while the account is loading.
| @@ -0,0 +1,35 @@ | |||
| EXPO_PUBLIC_BTC_PROVIDER=https://your-blockbook-instance.example.com | |||
There was a problem hiding this comment.
I think we can link to the wdk-docs here on how to retrieve these env vars
|
All review comments addressed. Key changes: removed react-native-worklet, added babel-preset-expo, committed lockfile, added withModularHeaders plugin for iOS pod install, fixed CloudKit sign-out WebView clearing, removed ?? '' passphrase fallback, gated recovery material logs behind DEV, fixed TRON BigInt crash, fixed silent send failure, moved payloadEncryption.ts out of app/ router tree, and updated docs. |
|
I re-approved, but I think you should resolve the comments @NirmalPatidar |
| "expo-crypto": "~55.0.16" | ||
| }, | ||
| "dependencies": { | ||
| "@ledgerhq/ledger-bitcoin": "^0.3.1", |
There was a problem hiding this comment.
remove ledger dep is not needed anymore
| "expo-splash-screen": "~55.0.20", | ||
| "expo-status-bar": "~55.0.6", | ||
| "expo-system-ui": "^55.0.17", | ||
| "ledger-bitcoin": "^0.2.3", |
| "author": "Tether", | ||
| "license": "Apache-2.0", | ||
| "overrides": { | ||
| "@tetherto/wdk-worklet-bundler": "github:claudiovb/wdk-worklet-bundler#1faee66fcc03acc172689e5d6a4406714399366a", |
There was a problem hiding this comment.
Is there a reason for the bundler override ? I think this one could be removed as well, its pinned on dev-deps already different case than the other three below...
…the demo .env.example as a faster alternative than setting up a whole env
This PR builds on top of the React Native Showcase work introduced in #15 by adding a complete Cloud Backup demonstration and testing experience to the showcase application.
The goal is to provide a dedicated UI that allows developers to validate and test the full Cloud Backup workflow end-to-end on both iOS and Android.
What's Included
☁️ Cloud Backup Showcase
Added a new Cloud Backup screen to the React Native Showcase application.
Provides a dedicated interface for testing all Cloud Backup functionality.
🔐 Authentication
Implemented login and logout flows for:
Apple CloudKit (iOS)
Google Drive (Android)
Displays the current authentication status.
📦 Cloud Backup Operations
Implemented support for testing the complete Cloud Backup lifecycle:
Create encrypted cloud backups
Restore backups from the cloud
Delete existing backups
Check backup availability
Display operation status and errors
Validate end-to-end backup and restore flows
🧪 Developer Experience
Added a simple UI for exercising all Cloud Backup APIs.
Makes it easier to validate Cloud Backup functionality during development and QA.
Helps reproduce and debug platform-specific issues.
📚 Documentation
Updated the Showcase documentation.
Added Cloud Backup documentation and setup guide.
Separated general project documentation from Cloud Backup configuration documentation.
Testing
Tested on:
✅ Android (Google Drive)
✅ iOS (CloudKit)
Verified:
Authentication
Backup creation
Backup restoration
Backup deletion
Logout/Login flows
Error handling
UI integration
Related
Builds on top of #15.