Class NfcYubiKeyManager


  • public class NfcYubiKeyManager
    extends java.lang.Object
    This class allows you to communicate with local NFC adapter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void disable​(android.app.Activity activity)
      Disable active listening of nfc events
      void enable​(android.app.Activity activity, NfcConfiguration nfcConfiguration, com.yubico.yubikit.core.util.Callback<? super NfcYubiKeyDevice> listener)
      Enable discovery of nfc tags for foreground activity
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NFC_SETTINGS_ACTION

        public static final java.lang.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:
        Constant Field Values
    • Constructor Detail

      • 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 Detail

      • 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