-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
additional migrations + abstract storage
- Loading branch information
Showing
30 changed files
with
662 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as Keychain from 'react-native-keychain'; | ||
|
||
class Storage { | ||
getItem = async (key: string) => { | ||
const response: any = await Keychain.getInternetCredentials(key); | ||
if (response.password) { | ||
return response.password; | ||
} | ||
return false; | ||
}; | ||
|
||
setItem = async (key: string, value: any) => { | ||
const response = await Keychain.setInternetCredentials( | ||
key, | ||
key, | ||
JSON.stringify(value) | ||
); | ||
return response; | ||
}; | ||
} | ||
|
||
const storage = new Storage(); | ||
export default storage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.