Class NfcYubiKeyManager

java.lang.Object
com.yubico.yubikit.android.transport.nfc.NfcYubiKeyManager

public class NfcYubiKeyManager extends Object
This class allows you to communicate with local NFC adapter
  • Field Details

    • NFC_SETTINGS_ACTION

      public static final String NFC_SETTINGS_ACTION
      Action for intent to tweak NFC settings in Android settings view on Q Android supports Settings.Panel.ACTION_NFC, we might update with release on Q
      See Also:
  • Constructor Details

    • NfcYubiKeyManager

      public NfcYubiKeyManager(android.content.Context context, @Nullable NfcDispatcher dispatcher) throws NfcNotAvailable
      Creates instance of NfcYubiKeyManager
      Parameters:
      context - the application context
      dispatcher - optional implementation of NfcDispatcher to use instead of the default.
      Throws:
      NfcNotAvailable - if the Android device does not support NFC
  • Method Details

    • enable

      public void enable(android.app.Activity activity, NfcConfiguration nfcConfiguration, com.yubico.yubikit.core.util.Callback<? super NfcYubiKeyDevice> listener) throws NfcNotAvailable
      Enable discovery of nfc tags for foreground activity
      Parameters:
      activity - activity that is going to dispatch nfc tags
      nfcConfiguration - additional configurations for NFC discovery
      listener - the listener to invoke on NFC sessions
      Throws:
      NfcNotAvailable - in case NFC is turned off (but available)
    • disable

      public void disable(android.app.Activity activity)
      Disable active listening of nfc events
      Parameters:
      activity - activity that goes to background or want to stop dispatching nfc tags