Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(props: {}) {
super(props);
Amplitude.initialize("31ef1b42450bb6c4372b30524c69b9a9");
Amplitude.setUserId("1");
Amplitude.setUserProperties({
age: 42
});
}
import { Platform, StatusBar, StyleSheet, View } from "react-native";
import { ApolloProvider } from "react-apollo";
import { AppLoading } from "expo";
import Constants from 'expo-constants';
import * as Font from 'expo-font';
import * as Amplitude from 'expo-analytics-amplitude';
import { Ionicons, Feather, MaterialIcons } from "@expo/vector-icons";
import Sentry from "sentry-expo";
import { client, persistor } from "./createApolloClient";
import RootNavigation from "./navigation/RootNavigation";
const { sentryUrl, amplitudeKey } = Constants.manifest.extra;
Sentry.config(sentryUrl).install();
Amplitude.initialize(amplitudeKey);
class App extends React.Component {
state = {
isLoadingComplete: false
};
async _prepareApp() {
await Promise.all([this._loadCache(), ...this._loadFonts()]);
}
_loadFonts() {
const fonts = [Ionicons.font, Feather.font, MaterialIcons.font];
return fonts.map(font => Font.loadAsync(font));
}
async _loadCache() {
export function initialize(): void {
if (isInitialized || !Environment.isProduction || !apiKey) {
return;
}
Amplitude.initialize(apiKey);
isInitialized = true;
}