oblador / react-native-keychain

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

Warning when using SetGenericPassword with service #618

Closed MartijnBooijAppronto closed 5 months ago

MartijnBooijAppronto commented 7 months ago

Hi, when we use SetGenericPassword as follows, we get a warning message in our log.

export async function JS_SetGenericPassword(username, password, service) {
    await Keychain.setGenericPassword(username, password, service);
}

Warning message is: You passed a service string as an argument to one of the react-native-keychain functions. This way of passing service is deprecated and will be removed in a future major

What should be future proof way?

clauderobi commented 5 months ago

Well, there is a further line in the warning message. It says this: Please update your code to use { service: "" }

This is not clear.... Is the service == username?

And where would this object go? In place of the secret argument?

And why wasn't the warning message sent on when using getPassphrase?

MartijnBooijAppronto commented 5 months ago

Hi, yes, I solved it already. Thx for replying.