Android
The Transak Android integration allows you to embed a fully functional interface directly into your native Android application using Webview.
Add Permissions in Manifest File
Update your AndroidManifest.xml to include required permissions for internet access and camera (for KYC verification):
Implement WebView in Activity
Configure your MainActivity to load the Transak widget URL using your preferred implementation:
Create Widget URL (using Backend Only)
Call the Create Widget URL to generate a Widget URL by securely passing the widget parameters.
The response returns a widgetUrl that should be used to load Transak in Android Webview.
A widgetUrl is valid for 5 minutes and can only be used once. A new widgetUrl must be generated for every user flow.
Example Request:
Use cases
Use the table below to choose the right approach for redirects, order data, and WebView events.
Deeplink
Transak supports deeplinking through the use of the redirectURL query parameter to enable seamless navigation after the purchase/sell process is completed.
Register Deeplink in AndroidManifest File
Add an intent filter to your AndroidManifest.xml to handle the deeplink:
Handle Deeplink and Parse Parameters
Listen for the deeplink and parse the returned parameters in your Activity.
When Transak redirects back, it includes additional query parameters appended to deeplink URL mentioned here.
Pass redirectURL in Create Widget URL API
Call the Create Widget URL to generate a Widget URL by securely passing the widget parameters along with the redirectURL parameter.
The response returns a widgetUrl that should be used to load Transak in Android Webview.
A widgetUrl is valid for 5 minutes and can only be used once. A new widgetUrl must be generated for every user flow.
Example Request:
Events
Transak allows listening of in-widget events (like order creation, completion, and widget close) through native event handlers in Android WebViews.
Add a JavaScript interface to your WebView using the handler name Android to listen for all frontend events.