Package repository
github.com/stashgg/stash-native
Package Readme
Detailed usage patterns.
Requirements
- Android API 21+ (target/compile SDK 34)
- iOS 13.0+
Install the SDK
1
Android (AAR)
- Download the latest AAR from stash-native releases.
- Add it to your Android project (for example in
libs/). - Reference it in your app module:
2
iOS (XCFramework or SPM)
Use one of the following:
- XCFramework: download
StashNative.xcframework.zipfrom releases, add it to your project, then set it to Embed & Sign. - Swift Package Manager: add
https://github.com/stashgg/stash-native.gitin Xcode (File -> Add Packages…).
Presentation methods
The SDK lets you present Stash Pay checkout links using three modes:openCard, openModal, and openBrowser.
Just provide your generated checkout URL, and you can also pass an optional config object to customize the presentation and subscribe to callbacks.

openCard (Drawer/sheet)
Use this when you want an in-app checkout view with callbacks for success/failure/dismiss.
- Android (Java)
- iOS (Swift)
- iOS (Objective-C)
openModal (Centered modal)
Use this when you want a centered dialog style with the same callback model as openCard.
- Android (Java)
- iOS (Swift)
- iOS (Objective-C)
openBrowser (Safari View Controller / Chrome Custom Tabs)
Use this when you prefer a browser-based checkout (SFSafariViewController on iOS, Chrome Custom Tabs/system browser on Android).
- Android (Java)
- iOS (Swift)
- iOS (Objective-C)
Callbacks and verification
openCard and openModal use the same callback/delegate model. Typical events:
- Payment success
- Payment failure
- Dialog dismissed
- External payment started
- Opt-in response
- Page loaded
- Network error
Landscape and orientation notes
UseforcePortrait in card config if your host app is landscape-locked and checkout should appear in portrait.
- On Android, this opens a portrait checkout activity in the same app process.
- On iOS, the SDK unlocks portrait for its own checkout/browser windows.
setBackdropBitmap / setBackdropBytes) can reduce visual artifacts during rotation.
Android keep-alive (optional)
For browser-based flows on memory-constrained devices, you can enable keep-alive:Detailed references
- Full SDK docs and examples: stash-native README
- Platform and policy notes: stash-native COMPATIBILITY.md
- Stash Pay backend integration flow: /guides/stash-pay/integration