How can I use it in an Activity
woxingxiao opened this issue ยท 1 comments
woxingxiao commented
Thanks for your excellent work for this lib. ๐๐
But why the BiometricHelper
has to be instanced in a fragment? How can I use it in an activity?
class BiometricHelper(private val fragment: Fragment)
Isn't this a better way?
class BiometricHelper(private val context: Context)
lopspower commented
Hello,
Sorry this is not possible due to the implementation of Google of BiometricPrompt.
You absolutely need a Fragment or a FragmentActivity:
https://developer.android.com/reference/androidx/biometric/BiometricPrompt#BiometricPrompt(androidx.fragment.app.FragmentActivity,%20java.util.concurrent.Executor,%20androidx.biometric.BiometricPrompt.AuthenticationCallback)