Mobile SDKs
Integrate seamlessly into iOS and Android apps
zerohash publishes native SDKs that present our flows inside your own app. Each SDK renders the zerohash mobile web app in a hardened WebView and bridges it to a typed native API, so you write ordinary Swift, Kotlin or TypeScript and never touch a WebView yourself.
Choose your platform
| Platform | Package | Guide |
|---|---|---|
| iOS | Swift Package Manager | iOS SDK |
| Android | Maven Central | Android SDK |
| Capacitor | npm | Capacitor plugin |
Flows
Three flows are available on every platform.
| Flow | What the user does |
|---|---|
| Fund | Deposits into their account, either manually, via Pay, or by connecting an external account |
| Crypto Withdrawals | Withdraws crypto to an external address, with no conversion |
| Fund Withdrawals | Withdraws to a linked destination, converting fiat to crypto on the way out |
The integration shape
Every flow on every platform follows the same three steps.
- Configure - Pass the JWT, the environment, the theme, and your event handlers. You get back a session object.
- Present - Show the flow. On iOS and Android it is presented from your view controller or activity; in Capacitor it is a single plugin call.
- Handle events - Your handlers fire as the flow progresses, and again when it reaches a terminal state.
Only one session can be presented at a time. Each session is single-use: configure a new one for the next flow rather than re-presenting a closed one.
Events mirror the web SDK
If you already integrate a zerohash web SDK, the native handlers should be fammiliar. The native SDKs deliberately keep the web handler names.
| Web SDK | iOS | Android | Capacitor event |
|---|---|---|---|
onLoaded | onLoaded | onLoaded | loaded |
onClose | onClose | onClose | close |
onError | onError | onError | error |
onEvent | onEvent | onEvent | event |
onCompleted | onCompleted | onCompleted | fundCompleted, withdrawalCompleted, fundWithdrawalCompleted |
onFailed | onFailed | onFailed | fundFailed, withdrawalFailed |
onDeposit | onDeposit | onDeposit | fundDeposit |
Capacitor is the one exception, and only for the events whose payload differs per flow. Its events are global to the plugin rather than scoped to a session object, so a bare completed would force every listener to work out which flow it came from before reading a field. Events whose payload is identical across flows stay bare: loaded, close, error and event. For more details, check each SDK README.
Versioning
The SDKs follow semantic versioning. A major version means a breaking API change, a minor adds backwards-compatible functionality, and a patch is a backwards-compatible fix. Pin to a major version and take minors and patches automatically; each platform guide shows how.
Full examples
Each platform guide covers requirements, installation and a minimal
integration. Complete per-flow examples, the full event payload reference, and
error type listings live in the SDK README, which is versioned with the code:
Updated 9 days ago