Welcome to our new developer portal! Use the "Ask" button to chat with our AI Agent.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Check Android Tap & Pay settings

Overview

If the device supports NFC Payment and NFC is enabled, Android uses a default payment application for contactless payments.

In Android, the end user can open Tap & Pay in NFC settings and choose the default payment application.

SDK

Check whether the issuer application is the default payment application

This code snippet shows how to check whether the issuer application is the default payment application.

fun isDefaultPaymentApp(context: Context) {
    val cardEmulation : CardEmulation = CardEmulation.getInstance(NfcAdapter.getDefaultAdapter(context))

    // Construct the ComponentName for the default HCE service class
    val componentName : ComponentName = ComponentName(context, D1HCEService::class.java.canonicalName as String)

    if (cardEmulation.isDefaultServiceForCategory(componentName, CardEmulation.CATEGORY_PAYMENT)) {
        // Issuer application is the default NFC payment application
    } else {
        // Issuer application is not the default NFC payment application
    }
}

Prompt the end user to change the default payment application

This code snippet shows how to prompt the end user to set the issuer application as the default payment application in Tap & Pay settings.

Last updated

Was this helpful?