2022-08-19 19:53:40 +00:00
|
|
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
2022-05-30 22:02:08 +00:00
|
|
|
|
|
|
|
import { ANALYTICS_EVENTS_KEY, CRASH_REPORT_KEY } from '../constants';
|
|
|
|
|
|
|
|
export async function getAllowCrashReport() {
|
|
|
|
const allowCrashReport = await AsyncStorage.getItem(CRASH_REPORT_KEY);
|
|
|
|
if (allowCrashReport === null) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return JSON.parse(allowCrashReport);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function getAllowAnalyticsEvents() {
|
|
|
|
const allowAnalyticsEvents = await AsyncStorage.getItem(ANALYTICS_EVENTS_KEY);
|
|
|
|
if (allowAnalyticsEvents === null) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return JSON.parse(allowAnalyticsEvents);
|
|
|
|
}
|