Open Piraban opened 4 years ago
My Keychain.ts file look like
` import { Storage } from 'redux-persist'; import * as RNKeychain from 'react-native-keychain'; import { Option, Compare } from 'nasi'; export class Keychain implements Storage { private options: RNKeychain.Options; private prefix = 'EEAAXXXXX.com.abcsgroup'; constructor(options?: RNKeychain.Options, prefix?: string) { this.options = options ?? {}; if (Option.isSome(prefix)) { this.prefix = prefix; } } public getItem = async (key: string) => { const service = `${this.prefix}${key}`; const response = await RNKeychain.getInternetCredentials( service, this.options, ); if (!response || !Compare.strEq(response.username, service)) { throw new Error('Keychain retrieval failed.'); } return response.password; }; public setItem = async (key: string, value: string) => { const service = `${this.prefix}${key}`; try { await this.getItem(key); await this.removeItem(key); } catch {} const response = await RNKeychain.setInternetCredentials( service, service, value, this.options, ); if (!response) { throw new Error('Keychain set failed.'); } }; public removeItem = async (key: string) => { const service = `${this.prefix}${key}`; return RNKeychain.resetInternetCredentials(service, this.options); }; } `
I added project.entitlements and info.plist added
```
<string>Enabling Face ID allows you quick and secure access to your account.</string>
But app is prompting to enter password for App on top of my main screen... may I know what is the reason it is prompting to enter keychain password?
What did you pass as accessControl in your options?
accessControl
My Keychain.ts file look like
I added project.entitlements and info.plist added