Skip to main content
Version: 3.0.0

Setup

In order for your app to interact with Coinbase Wallet, you must add a queries element to your AndroidManifest.xml file, specifying the package name for Coinbase Wallet, org.toshi.

<queries>
<package android:name="org.toshi" />
</queries>

Before the SDK can be used, it needs to be configured with an App Link to your application. This callback URL will be used by the Coinbase Wallet application to navigate back to your application.

CoinbaseWalletSDK(
appContext = applicationContext,
domain = Uri.parse("https://www.myappxyz.com"),
openIntent = { intent -> launcher.launch(intent) }
)

When your application receives a response from Coinbase Wallet via App Links, this URL needs to be handed off to the SDK via the handleResponse function.

launcher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
val uri = result.data?.data ?: return@registerForActivityResult
client.handleResponse(uri)
}

An example is provided in our sample application.

Was this helpful?