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

Can't use imageColor Prop, Causes Android Error #199

Closed
cameroncharles opened this issue Feb 22, 2019 · 1 comment
Closed

Can't use imageColor Prop, Causes Android Error #199

cameroncharles opened this issue Feb 22, 2019 · 1 comment

Comments

@cameroncharles
Copy link

Recently updated to the latest version of the library to get the Fingerprint icon working on Android thanks to PR 163, previously i was just getting the solid circle of color as many other people were.

The upgrade is fine in every other regard except if i try to use the imageColor (or imageErrorColor) prop, i'm using it exactly as the docs say but i keep getting an Android level error.

Here's the code i'm using, as you can see apart from the double quotes, which aren't the issue, its the same as the docs.
TouchID.authenticate("Please register your biometric information", { title: "Biometric Registration", cancelText: "Cancel", sensorDescription: "Touch sensor", sensorErrorDescription: "Touch sensor", imageColor: "#ff00cc", });

And here's the error that's shown when the dialog is triggered:

Value for imageColor cannot be cast from String to Double

From a brief bit of research is appears to be this line that throws the error, indeed if i add a PorterDuff.mode as the second parameter it runs just fine and accepts the color and performs the PorterDuff blend
Without this second param though i could not get it working.

Adding the PorterDuff mode param isn't the real solution here hence no PR, as this doesn't provide a facility to change the color of the icon as the prop suggests.

Im using RN 0.57 and various Android versions but mostly API27

@cameroncharles
Copy link
Author

So after posting this i cleared my NPM cache for unrelated reasons and the icon returned to being the solid color circle, in the fallback blue color, not sure why, I tried the imageColor prop again and it worked but it just changes the color of the solid circle, setting it to "transparent" however allows the dialog to display the nice dark green with white thumbprint icon.

I think the icon and color handling needs a rework but as far as this github issue goes the "problem" is no longer the same as what is described so ill close it.

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

No branches or pull requests

1 participant