Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to AndroidX prompt #2

Closed
wants to merge 1 commit into from
Closed

Conversation

aeirola
Copy link

@aeirola aeirola commented Oct 15, 2019

I had some issues with the code in oblador#195 related to the biometric prompt not working correctly on certain devices. This was fixed in the latest AndroidX releases (https://stackoverflow.com/a/57085599), so needed to move to AndroidX to fix the issue.

Since there were talks about moving to AndroidX in the feature PR, I thought I'd share the work I done with you in case you have some use for it.

Runnable myRunnable = new Runnable() {
@Override
public void run() {
mBiometricPrompt.authenticate(promptInfo);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had some issues with FragmentManager throwing errors when this was not run in the main thread. This is also mentioned in the FragmentManager documentation https://developer.android.com/reference/androidx/fragment/app/FragmentManager.html#executePendingTransactions()

@@ -317,6 +327,6 @@ private String decryptBytes(Key key, byte[] bytes) throws CryptoFailedException,

@Override
public void setCurrentActivity(Activity activity) {
mActivity = activity;
mActivity = (FragmentActivity) activity;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the BiometricPrompt uses Fragments, the activity now needs to be a FragmentActivity. New versions of ReactNative seem to provide FragmentActivities, so this cast seems to work.

@aeirola
Copy link
Author

aeirola commented Oct 21, 2019

Okay, seems like you already implemented similar changes in the branch. Closing this PR.

@aeirola aeirola closed this Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant