Add React Native bindings for payjoin-ffi - #1851
Open
xstoicunicornx wants to merge 1 commit into
Open
Conversation
xstoicunicornx
requested review from
DanGould,
benalleng and
spacebear21
as code owners
August 29, 2026 05:34
Introduce a dedicated react-native/ package that exposes payjoin-ffi to React Native via a JSI Turbo Module, using uniffi-bindgen-react-native. Unlike the sibling javascript/ bindings, which target WebAssembly through `ubrn build web`, these build the payjoin-ffi cdylib/staticlib directly for iOS and Android. React Native cannot run the wasm build (Hermes has no WebAssembly support), so native bindings are required to consume payjoin from a React Native app. The generated native projects, C++ glue, and TypeScript bindings are not committed; they are produced from the hand-authored anchor files by scripts/generate_bindings.sh. Per-platform build tests live in scripts/test_ios.sh and scripts/test_android.sh; contrib/test.sh mirrors the javascript/ crate and gates on typecheck.
Collaborator
Coverage Report for CI Build 33236595566Coverage remained the same at 86.64%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce a dedicated react-native package that exposes React Native bindings via a JSI Turbo Module, using uniffi-bindgen-react-native.
Unlike the sibling javascript/ bindings, which target WebAssembly through
ubrn build web, these build the payjoin-ffi cdylib/staticlib directly for iOS and Android. React Native cannot run the wasm build (Hermes has no WebAssembly support), so native bindings are required to consume payjoin from a React Native app.The generated native projects, C++ glue, and TypeScript bindings are not committed; they are produced from the hand-authored anchor files by scripts/generate_bindings.sh. Per-platform build tests live in scripts/test_ios.sh and scripts/test_android.sh; contrib/test.sh mirrors the javascript/ crate and gates on typecheck.
Testing
I tested these bindings using https://github.com/xstoicunicornx/react-native-payjoin/blob/master/package.json.
There are no integration or unit tests shipped with these bindings as that would require a full emulator install and seemed overkill. The Javascript bindings currently build from the same source code + uniffi-bindgen-react-native library and might be good enough to lean on as proxy testing. However, I am open to suggestions on what a good way to add tests to the react native bindings might be.
Follow ups
CI and nixify-ing was intentionally left as a follow up. I did want to get feedback on what all should be included in CI, as running integration tests would require installing a full emulator. Right now I am leaning towards only checking that build passes. Additionally, the iOS builds will not be able to be run in a nix development environment. Would love feedback on how either of these should be handled.
Disclosure: Made with the help of Claude Opus 4.8.
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.