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

Since v1.22.0 TouchID pops up each time the package is imported #133

Closed
tststs opened this issue Mar 27, 2020 · 8 comments
Closed

Since v1.22.0 TouchID pops up each time the package is imported #133

tststs opened this issue Mar 27, 2020 · 8 comments

Comments

@tststs
Copy link

tststs commented Mar 27, 2020

Every time i import anything from @haskkor/react-native-pincode the "Authentication required" screen pops up and asks for the fingerprint. At this point i'm not rendering any component yet.

This only happens after upgrading to v.1.22.*

Has anything changed that i'm not aware of?

Thanks!

@efronnyp
Copy link

efronnyp commented Apr 4, 2020

Hi @tststs. Have you solved your issue yet? If not, I'm facing the same issue as yours.

I don't know if it's also related to you, but in my case I found that by calling hasUserSetPinCode() will trigger the Keychain.getInternetCredentials(serviceName) command (see src/utils.ts file).

By calling the Keychain.getInternetCredentials(serviceName), Android OS will ask the phone user to scan their finger in order to access the Keychain, thus make the touch id dialog appeared.

So in my case, I just remove the hasUserSetPinCode() and find the workaround solution.

Hope this helps.

@jeremy-farnault
Copy link
Contributor

Thanks @efronnyp
Waiting to see if it's the same for @tststs before deciding on the next step.

@camilo5972
Copy link

The same error for me with hasUserSetPinCode(), android pops up the "Authentication required" message.

React Native: 0.61.5
react-native-pincode: 1.22.2

@bd-arc
Copy link

bd-arc commented May 1, 2020

Can confirm that I'm facing the same issue on Android. Does anyone know how this should be addressed?

React Native: 0.61.5
react-native-pincode: 1.22.2

@bd-arc
Copy link

bd-arc commented May 1, 2020

Just discovered that the issue also occurs without calling hasUserSetPinCode() at all. It just requires you to set pin code's statut to enter.

This doesn't happen if prop status is set to choose, which I guess makes sense since Keychain.getInternetCredentials() is probably not called in that very case.

@OlMrGreen
Copy link

OlMrGreen commented Jun 30, 2020

Just discovered that the issue also occurs without calling hasUserSetPinCode() at all. It just requires you to set pin code's statut to enter.

This doesn't happen if prop status is set to choose, which I guess makes sense since Keychain.getInternetCredentials() is probably not called in that very case.

I can confirm that touchID on android always pops up when Keychain.getInternetCredentials() is called (even though touchIDDisabled is set to true).

For v1.22.3 a possible workaround is to set the storedPin attribute inside <PINCode />.
So you basically have to manage the pin storage yourself.

It marks an exception for the call of that Keychain.getInternetCredentials() function, as can be seen here:

https://github.com/jarden-digital/react-native-pincode/blob/master/src/PinCodeEnter.tsx : 108

constructor(props: IProps) {
  super(props)
    this.state = { pinCodeStatus: PinResultStatus.initial, locked: false }
    this.endProcess = this.endProcess.bind(this)
    this.launchTouchID = this.launchTouchID.bind(this)
    if (!this.props.storedPin) {
      Keychain.getInternetCredentials(
        this.props.pinCodeKeychainName
      ).then(result => {
        this.keyChainResult = result && result.password || undefined
      }).catch(error => {
        console.log('PinCodeEnter: ', error)
      })
    }
  }

I spent the whole afternoon trying to get around that bug. Hope that helps someone.

@jlindberg-oss
Copy link

Just wondering if anyone has solved this issue properly or made use of the workaround from @OlMrGreen ?

I just go through implementing this library testing with only the iOS, and then saw this issue 😿.

@jeremy-farnault
Copy link
Contributor

#154 merged. Will publish asap

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

7 participants