epicshaggy / capacitor-native-biometric

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In IOS 17, the plugin propably does not work properly

meesha81 opened this issue · comments

Hi,
it looks like IOS 17 is not supported by the plugin at this time. We are using forked version Capgo, but we don't know if this is your issue. Is IOS 17 supported by your "original" plugin version?

We get an error:
Error: The operation couldn't be completed. (CapgoCapacitorNativeBiometric.NativeBiometric.KeyChainError error 0

when we call

        await NativeBiometric.setCredentials({
          username: credentials.email,
          password: credentials.password,
          server: APP_ID,
        });

It would be nice if the plugin supports the new IOS 17 as well.

Thank you for your interest.

We've run into this with the latest iOS 17 RC, but it's error 1 and it seems pretty inconsistent. Has anyone else seen this?

I've seen this on iOS 17 only.
setCredentials throws up an error when testing on an iPad 9th Gen (iPad OS 17).
No error on an iPad running iPad OS 16 or iPhones running iOS 16, and you can set credentials successfully.
I used a catch statement and collected the error:
Error: The operation couldn't be completed. (CapacitorNativeBiometric.NativeBiometric.KeychainError error 0.)

Hi guys. There is a solution for how this plugin works on ios 17

In Xcode -> Info.plist.
Add -> Privacy - Face ID Usage entry
Value -> NSFaceIDUsageDescription
Save the changes

Hi, I'm pretty sure I tried that already and I was still getting the same error.
I have just this morning found a work around for this problem on iOS 17 as per this thread on the capgo fork of this plugin:
Cap-go#5

You need to deleteCredentials before you use setCredentials (even if you don't have any set yet). I have no more errors when I do this.

Hi @AbidR-S2 , I get the error when I getCredentials as well, so your proposed fix doesn't really apply.

NativeBiometric getCredentials 123981411 ERROR MESSAGE: {"errorMessage":"The operation couldn’t be completed. (CapacitorNativeBiometric.NativeBiometric.KeychainError error 1.)","message":"The operation couldn’t be completed. (CapacitorNativeBiometric.NativeBiometric.KeychainError error 1.)"}

Any ideas?

That's weird, getCredentials is working for me once setCredentials is successful.

The KeychainError is different in your case too. Error 1 as opposed to error 0.

I can give you the code that I use to getCredentials if that helps:

try {
    savedCredentials = await NativeBiometric.getCredentials({
      server: constants.biometricsServerKey
    });
} catch (exception) {
      this.displayInvalidBiometricLoginAlert();
      return;
}

@AbidR-S2 looks like that error is thrown when you try to getCredentials when none are set.