Skip to content

Add React Native bindings for payjoin-ffi - #1851

Open
xstoicunicornx wants to merge 1 commit into
payjoin:masterfrom
xstoicunicornx:rn
Open

Add React Native bindings for payjoin-ffi#1851
xstoicunicornx wants to merge 1 commit into
payjoin:masterfrom
xstoicunicornx:rn

Conversation

@xstoicunicornx

Copy link
Copy Markdown
Collaborator

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:

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.
@coveralls

coveralls commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 33236595566

Coverage remained the same at 86.64%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 16474
Covered Lines: 14273
Line Coverage: 86.64%
Coverage Strength: 343.08 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants