Closed winnerawan closed 3 years ago
Hi @winnerawan ,
There are 2 different cancel types. First is if you manually call cancel
method, second is if the User himself presses on the Cancel button.
In the first scenario, nothing will be triggered on the callback because if you cancel the authentication yourself, you don't want potential callback being triggered because it could leak and cause a crash while you are navigating to another screen.
In the second scenario, when the User cancels the authentication himself, you will get a callback to onResult
with specific USER_CANCELED
reason which can be found here.
I also suggest looking at other enumerations to see which other cases are covered.
Thanks for reply @domagojkorman i think it's the second scenario, when dialog pop up shown, user choose cancel. below code doesn't work, i dont get toast message
if (result.reason() == Goldfinger.Reason.CANCELED) {
Toast.makeText(getBaseActivity(), "CANCEL", Toast.LENGTH_SHORT).show();
}
Did you try using Goldfinger.Reason.USER_CANCELED
? The exact enum that I linked in my previous response - here
Actually it's Goldfinger.Reason.NEGATIVE_BUTTON
i think i need sleep and read it again, sorry, my bad.
case closed
how to handle cancel ?
Goldfinger.Callback()
only hasonResult
andonError