oblador / react-native-keychain

:key: Keychain Access for React Native
MIT License
3.12k stars 515 forks source link

feat: hasGenericPassword #642

Open DorianMazur opened 4 days ago

DorianMazur commented 4 days ago

Description

This new function hasGenericPasswordForService for both iOS and Android platforms. This function checks if a generic password exists for a given service and returns a Promise.

Motivation and Context

In some applications, it's crucial to verify the existence of data in the Keychain (iOS) or Shared Preferences (Android) before attempting to access it (for example when you store encryption key to decrypt the data) This function provides a convenient way to perform this check, similar to the existing hasInternetCredentials function.

Also it should help to solve the issue #135 & #533 We will have a way to determine if the data is in Keychain.

How Has This Been Tested?

Manually tested in a real React Native project on iOS & Android.