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
const axios = require("axios"); | |
const bitwardenApiUrl = "http://localhost:8087"; | |
const MASTER_PWD = "xxx"; | |
// Function to unlock the vault | |
async function unlock() { | |
try { | |
const { data: unlockRes } = await axios.post(`${bitwardenApiUrl}/unlock`, { | |
password: MASTER_PWD, |
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
AppStore | |
6.5 - iPhone 11 Pro Max (iPhone Xs Max) | |
5.5 - iPhone 8 Plus (iPhone 7 Plus, iPhone 6s Plus) | |
iPad Pro (12.9-inch) |
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
// useful to debug js code errors | |
adb logcat "*:S" ReactNative:V ReactNativeJS:V | |
// useful to debug native errors (when the app won't even start) | |
adb logcat "*:E" |
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
import { useState, useEffect } from 'react'; | |
import { Platform } from 'react-native'; | |
import codePush from 'react-native-code-push'; | |
import env from '../constants/env'; | |
const { CODEPUSH_IOS_KEY, CODEPUSH_ANDROID_KEY } = env; | |
export default function useCodePush() { | |
const [ready, setReady] = useState(false); |
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
function AppStateChecker() { | |
const cachedAppState = useRef(AppState.currentState); | |
const _handleAppStateChange = useCallback(nextAppState => { | |
console.log(cachedAppState.current, nextAppState); | |
if (_backgroundState(nextAppState)) { | |
console.log('App is going background'); | |
} else if ( | |
_backgroundState(cachedAppState.current) && |
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
const _toQueryString = params => | |
`?${Object.entries(params) | |
.map( | |
([key, value]) => | |
`${encodeURIComponent(key)}=${encodeURIComponent(value)}` | |
) | |
.join("&")}`; | |
// EDIT here if you prefer a storage implementation or a store subscription etc. | |
// you could actually also remove the getToken function and directly call it in the header below |