RxBiometric icon indicating copy to clipboard operation
RxBiometric copied to clipboard

onComplete is not being called

Open natiginfo opened this issue 5 years ago • 5 comments

When I try to authenticate via fingerprint, onComplete is being invoked. After that, if I try to authenticate again successfully, onComplete is not being invoked.

natiginfo avatar Mar 25 '19 12:03 natiginfo

Hi,

Thanks for reporting that. Hm, I'm not sure if this is a bug. Actually, once you're authenticated and onComplete is invoked, then stream is finished, so it will no longer be active. When you restart Activity or invoke this in another Activity, it should work fine. I think, invoking onComplete twice on the same stream within the same Activity (without restarting/stopping/resuming Activity) doesn't really make sense.

pwittchen avatar Mar 25 '19 18:03 pwittchen

Hi, In single activity apps, it’s not possible to authenticate more than once, and it’s a problem.

natiginfo avatar Mar 25 '19 18:03 natiginfo

It's done like that by design. Do you have a use case, in which you're authenticating user twice within a single activity? Can you explain situation your app? If it will make sense, then we can think about re-designing the library.

pwittchen avatar Mar 25 '19 18:03 pwittchen

Sure. In our case, we use biometric authentication for login. However, user can choose to logout later and in that case app shows login view again. So, app has single activity and we use fragments. I believe, it’s possible use case for many apps, which use single activity approach, as navigation components has already stable versions too.

natiginfo avatar Mar 25 '19 19:03 natiginfo

Ok, I'll have a look how to update the library to make it work for your case.

pwittchen avatar Mar 25 '19 19:03 pwittchen