Integration with Mobile Apps

Overview

This guide explains how to integrate the Zero Hash SDK with mobile applications. The integration is done via a WebView that calls our proxy service, sdk-mobile, with the necessary parameters.

Integration Steps

1. Open WebView with SDK-Mobile Proxy

To integrate the Zero Hash SDK into your mobile application, you need to open a WebView and navigate to the sdk-mobile proxy service. The URL must include the following parameters:

  • zeroHashAppsURL: The base URL for Zero Hash applications.
    • Possible options are:
      • Certification (cert): https://web-sdk.cert.zerohash.com
      • Production (prod): https://web-sdk.zerohash.com
  • One of the following JWT parameters:
    • fiatWithdrawalsJWT
    • fiatDepositsJWT
    • cryptoBuyJWT
    • cryptoSellJWT
    • cryptoWithdrawalsJWT
    • userOnboardingJWT
    • fundJWT
    • profileJWT
    • cryptoAccountLinkJWT

For more information on how to generate the JWT, please refer to our JWT documentation

2. Example URL Format

Certification Environment (For Testing & Development):

Our sdk-mobileis hosted under https://sdk-mobile.zerohash.com/v1, so use this URL when working in a test or development environment.

Here's an example URL:

https://sdk-mobile.cert.zerohash.com/v1?zeroHashAppsURL=https://web-sdk.cert.zerohash.com&<selectedJWT>=<your_jwt_token>

Production Environment (For Live Deployments):

Use this URL when deploying in a live production environment:

https://sdk-mobile.zerohash.com/v1?zeroHashAppsURL=https://web-sdk.zerohash.com&<selectedJWT>=<your_jwt_token>

Important: Ensure that you are using the correct URL based on your environment. The Certification Environment is meant for testing purposes only, while the Production Environment should be used for actual user transactions. The zeroHashAppsURLyou send should match your selected sdk-mobile environment, otherwise the integration will not work properly.

3. Handling the WebView

Ensure that your mobile application handles WebView navigation securely and correctly passes the required parameters/permissions. The WebView should support JavaScript execution. Here are the guide for integrating with modern tools:

You'll notice that on all guides above there's an appIdentifier attribute on them. Here's all the possible values for them (column App Identifier postMessage), use according to the product you want to invoke on your application.

ProductApp Identifier (postMessage)JWT Identifier (to get JWT)sdk-mobile (to use on sdk-mobile url)zh-web-sdk (to use on ZeroHashSDK class)
OnboardingonboardingonboardinguserOnboardingJWTuserOnboardingJWT
Profileprofileparticipant-profileprofileJWTprofileJWT
Crypto Account Linkcrypto-account-linkcrypto-account-linkcryptoAccountLinkJWTcryptoAccountLinkJWT
Crypto Buycrypto-buycrypto-buycryptoBuyJWTcryptoBuyJWT
Crypto Sellcrypto-sellcrypto-sellcryptoSellJWTcryptoSellJWT
Crypto Withdrawalscrypto-withdrawalscrypto-withdrawalscryptoWithdrawalsJWTcryptoWithdrawalsJWT
Fiat Depositsfiat-depositsfiat-depositsfiatDepositsJWTfiatDepositsJWT
Fiat Withdrawalsfiat-withdrawalsfiat-withdrawalsfiatWithdrawalsJWTfiatWithdrawalsJWT
FundfundfwcfundJWTfundJWT
Fund Withdrawalscrypto-withdrawalscrypto-withdrawalscryptoWithdrawalsJWTcryptoWithdrawalsJWT

Additional Considerations

  • Always use HTTPS for secure communication.

For more details, refer to the Zero Hash API documentation or contact support.