capacitor-native-biometric icon indicating copy to clipboard operation
capacitor-native-biometric copied to clipboard

bug: error when saving credentails

Open Saqib92 opened this issue 4 months ago • 3 comments

Version

7.1.13

Platform(s)

  • [ ] Android
  • [x] iOS
  • [ ] Web

Current behavior

getting this error on saveCredentails

errorMessage: "The operation couldn’t be completed. (CapgoCapacitorNativeBiometric.NativeBiometric.KeychainError error 0.)"

Expected behavior

should save credentials.

Reproduction

No response

Steps to reproduce

install plugin latest version: npm i @capgo/capacitor-native-biometric use code: async setCredentials(email: string, password: string, server: string) { try { await NativeBiometric.setCredentials({ username: email, password: password, server: server, })

} catch (e) {
  this.saveErrorLog(e);
}

}

Other information

No response

Capacitor doctor

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 7.4.3
  @capacitor/core: 7.4.3
  @capacitor/android: 7.4.3
  @capacitor/ios: 7.4.3

Installed Dependencies:

  @capacitor/cli: 7.4.3
  @capacitor/android: 7.4.3
  @capacitor/core: 7.4.3
  @capacitor/ios: 7.4.3

[success] iOS looking great! 👌
[success] Android looking great! 👌

Before submitting

  • [x] I have read and followed the bug report guidelines.
  • [x] I have attached links to possibly related issues and discussions.
  • [x] I understand that incomplete issues (e.g. without reproduction) are closed.

Fastest way to fix this issue

Saqib92 avatar Sep 18 '25 12:09 Saqib92

hey @Saqib92 we had issue on the name when we migrated to new arch please test it again it should work

riderx avatar Oct 26 '25 16:10 riderx

i fixed it by deleting previously saved credentials:

saveData(email: string, password: string, server: string){
  await NativeBiometric.deleteCredentials({ server: server }); // adding this line fixed the issue
  
  await NativeBiometric.setCredentials({
    username: email,
    password: password,
    server: server,
  })
}

Saqib92 avatar Oct 28 '25 07:10 Saqib92

@Saqib92 I’ll recheck if it’s fixed without this extra line.

WcaleNieWolny avatar Oct 28 '25 08:10 WcaleNieWolny