import * as ReactNativeKeychain from "react-native-keychain" ; param username param password param server export async function save ( username , password , server ? ) { if ( server ) { await ReactNativeKeychain . setInternetCredentials ( server , username , password ) ; return true ; } else { return ReactNativeKeychain . setGenericPassword ( username , password ) ; } } param server export async function load ( server ? ) { if ( server ) { const creds = await ReactNativeKeychain . getInternetCredentials ( server ) ; return { username : creds ? creds . username : null , password : creds ? creds . password : null , server , } ; } else { const creds = await ReactNativeKeychain . getGenericPassword ( ) ; if ( typeof creds === "object" ) { return { username : creds . username , password : creds . password , server : null , } ; } else { return { username : null , password : null , server : null , } ; } } } param server export async function reset ( server ? ) { if ( server ) { await ReactNativeKeychain . resetInternetCredentials ( server ) ; return true ; } else { const result = await ReactNativeKeychain . resetGenericPassword ( ) ; return result ; } }