How to use the expo-analytics-amplitude.initialize function in expo-analytics-amplitude

To help you get started, we’ve selected a few expo-analytics-amplitude examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github janaagaard75 / expo-and-typescript / src / AmplitudeScreen.tsx View on Github external
constructor(props: {}) {
    super(props);

    Amplitude.initialize("31ef1b42450bb6c4372b30524c69b9a9");
    Amplitude.setUserId("1");
    Amplitude.setUserProperties({
      age: 42
    });
  }
github bastiRe / eLadder / app / App.js View on Github external
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() {
github expo / expo / home / api / Analytics.ts View on Github external
export function initialize(): void {
  if (isInitialized || !Environment.isProduction || !apiKey) {
    return;
  }

  Amplitude.initialize(apiKey);
  isInitialized = true;
}

expo-analytics-amplitude

Provides access to Amplitude (https://amplitude.com/) mobile analytics. This module wraps Amplitude-iOS (https://github.com/amplitude/Amplitude-iOS) and Android (https://github.com/amplitude/Amplitude-Android) SDKs.

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis