How to use appcenter - 10 common examples

To help you get started, we’ve selected a few appcenter 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 microsoft / appcenter-sdk-react-native / TestApp / app / screens / AppCenterScreen.js View on Github external
const refreshAppCenterScreen = navigation.getParam('refreshAppCenterScreen');

      // Initial press: the function is not defined yet so nothing to refresh.
      if (refreshAppCenterScreen) {
        refreshAppCenterScreen();
      }
      defaultHandler();
    }
  }

  state = {
    appCenterEnabled: false,
    pushEnabled: false,
    authEnabled: false,
    installId: '',
    sdkVersion: AppCenter.getSdkVersion(),
    startupMode: StartupModes[0],
    appSecret: AppSecrets[0],
    userId: '',
    accountId: '',
    authStatus: 'Authentication status unknown'
  }

  async componentDidMount() {
    await this.refreshUI();
    const startupModeKey = await AsyncStorage.getItem(STARTUP_MODE);
    for (let index = 0; index < StartupModes.length; index++) {
      const startupMode = StartupModes[index];
      if (startupMode.key === startupModeKey) {
        this.state.startupMode = startupMode;
        break;
      }
github microsoft / appcenter-sdk-react-native / DemoApp / app / screens / AppCenterScreen.js View on Github external
const refreshAppCenterScreen = navigation.getParam('refreshAppCenterScreen');

      // Initial press: the function is not defined yet so nothing to refresh.
      if (refreshAppCenterScreen) {
        refreshAppCenterScreen();
      }
      defaultHandler();
    }
  }

  state = {
    appCenterEnabled: false,
    pushEnabled: false,
    authEnabled: false,
    installId: '',
    sdkVersion: AppCenter.getSdkVersion(),
    startupMode: StartupModes[0],
    userId: '',
    accountId: '',
    authStatus: 'Authentication status unknown'
  }

  async componentDidMount() {
    await this.refreshUI();
    const startupModeKey = await AsyncStorage.getItem(STARTUP_MODE);
    for (let index = 0; index < StartupModes.length; index++) {
      const startupMode = StartupModes[index];
      if (startupMode.key === startupModeKey) {
        this.state.startupMode = startupMode;
        break;
      }
    }
github esteemapp / esteem-mobile / index.js View on Github external
import { AppRegistry } from 'react-native';
import AppCenter from 'appcenter';
import codePush from 'react-native-code-push';
import { name as appName } from './app.json';
import 'core-js';
import 'intl';
import 'intl/locale-data/jsonp/en-US';

// set check frequency options
const codePushOptions = { checkFrequency: codePush.CheckFrequency.ON_APP_START };
const eSteemApp = codePush(codePushOptions)(require('./App').default);

AppCenter.setLogLevel(AppCenter.LogLevel.VERBOSE);

AppRegistry.registerComponent(appName, () => eSteemApp);
github microsoft / appcenter-sdk-react-native / TestApp / app / screens / AppCenterScreen.js View on Github external
onSubmit: async () => {
                    // We use empty text in UI to delete userID (null for AppCenter API).
                    const userId = this.state.userId.length === 0 ? null : this.state.userId;
                    if (userId !== null) {
                      await AsyncStorage.setItem(USER_ID_KEY, userId);
                    } else {
                      await AsyncStorage.removeItem(USER_ID_KEY);
                    }
                    await AppCenter.setUserId(userId);
                  }
                },
github microsoft / appcenter-sdk-react-native / DemoApp / app / screens / AppCenterScreen.js View on Github external
onSubmit: async () => {
                    // We use empty text in UI to delete userID (null for AppCenter API).
                    const userId = this.state.userId.length === 0 ? null : this.state.userId;
                    if (userId !== null) {
                      await AsyncStorage.setItem(USER_ID_KEY, userId);
                    } else {
                      await AsyncStorage.removeItem(USER_ID_KEY);
                    }
                    await AppCenter.setUserId(userId);
                  }
                },
github microsoft / appcenter-sdk-react-native / appcenter / AppCenter.js View on Github external
const ReactNative = require('react-native');

const { AppCenterReactNative } = ReactNative.NativeModules;
const AppCenterLog = require('appcenter/appcenter-log');
const PackageJson = require('./package.json');

const logTag = 'AppCenter';

const AppCenter = {
    LogLevel: {
        VERBOSE: AppCenterLog.LogLevelVerbose,     // Logging will be very chatty
        DEBUG: AppCenterLog.LogLevelDebug,         // Debug information will be logged
        INFO: AppCenterLog.LogLevelInfo,           // Information will be logged
        WARNING: AppCenterLog.LogLevelWarning,     // Errors and warnings will be logged
        ERROR: AppCenterLog.LogLevelError,         // Errors will be logged
        ASSERT: AppCenterLog.LogLevelAssert,       // Only critical errors will be logged
        NONE: AppCenterLog.LogLevelNone            // Logging is disabled
    },

    /**
     * @deprecated Use `LogLevel.VERBOSE` instead.
     */
    LogLevelVerbose: AppCenterLog.LogLevelVerbose,

    /**
     * @deprecated Use `LogLevel.DEBUG` instead.
     */
    LogLevelDebug: AppCenterLog.LogLevelDebug,

    /**
     * @deprecated Use `LogLevel.INFO` instead.
     */
github microsoft / appcenter-sdk-react-native / appcenter / AppCenter.js View on Github external
LogLevelInfo: AppCenterLog.LogLevelInfo,

    /**
     * @deprecated Use `LogLevel.WARNING` instead.
     */
    LogLevelWarning: AppCenterLog.LogLevelWarning,

    /**
     * @deprecated Use `LogLevel.ERROR` instead.
     */
    LogLevelError: AppCenterLog.LogLevelError,

    /**
     * @deprecated Use `LogLevel.ASSERT` instead.
     */
    LogLevelAssert: AppCenterLog.LogLevelAssert,

    /**
     * @deprecated Use `LogLevel.NONE` instead.
     */
    LogLevelNone: AppCenterLog.LogLevelNone,

    // async - returns a Promise
    startFromLibrary(service) {
        return AppCenterReactNative.startFromLibrary(service);
    },

    // async - returns a Promise
    getLogLevel() {
        return AppCenterReactNative.getLogLevel();
    },
github microsoft / appcenter-sdk-react-native / appcenter / AppCenter.js View on Github external
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

const ReactNative = require('react-native');

const { AppCenterReactNative } = ReactNative.NativeModules;
const AppCenterLog = require('appcenter/appcenter-log');
const PackageJson = require('./package.json');

const logTag = 'AppCenter';

const AppCenter = {
    LogLevel: {
        VERBOSE: AppCenterLog.LogLevelVerbose,     // Logging will be very chatty
        DEBUG: AppCenterLog.LogLevelDebug,         // Debug information will be logged
        INFO: AppCenterLog.LogLevelInfo,           // Information will be logged
        WARNING: AppCenterLog.LogLevelWarning,     // Errors and warnings will be logged
        ERROR: AppCenterLog.LogLevelError,         // Errors will be logged
        ASSERT: AppCenterLog.LogLevelAssert,       // Only critical errors will be logged
        NONE: AppCenterLog.LogLevelNone            // Logging is disabled
    },

    /**
     * @deprecated Use `LogLevel.VERBOSE` instead.
     */
    LogLevelVerbose: AppCenterLog.LogLevelVerbose,

    /**
     * @deprecated Use `LogLevel.DEBUG` instead.
     */
    LogLevelDebug: AppCenterLog.LogLevelDebug,
github microsoft / appcenter-sdk-react-native / appcenter / AppCenter.js View on Github external
INFO: AppCenterLog.LogLevelInfo,           // Information will be logged
        WARNING: AppCenterLog.LogLevelWarning,     // Errors and warnings will be logged
        ERROR: AppCenterLog.LogLevelError,         // Errors will be logged
        ASSERT: AppCenterLog.LogLevelAssert,       // Only critical errors will be logged
        NONE: AppCenterLog.LogLevelNone            // Logging is disabled
    },

    /**
     * @deprecated Use `LogLevel.VERBOSE` instead.
     */
    LogLevelVerbose: AppCenterLog.LogLevelVerbose,

    /**
     * @deprecated Use `LogLevel.DEBUG` instead.
     */
    LogLevelDebug: AppCenterLog.LogLevelDebug,

    /**
     * @deprecated Use `LogLevel.INFO` instead.
     */
    LogLevelInfo: AppCenterLog.LogLevelInfo,

    /**
     * @deprecated Use `LogLevel.WARNING` instead.
     */
    LogLevelWarning: AppCenterLog.LogLevelWarning,

    /**
     * @deprecated Use `LogLevel.ERROR` instead.
     */
    LogLevelError: AppCenterLog.LogLevelError,
github microsoft / appcenter-sdk-react-native / appcenter / AppCenter.js View on Github external
const ReactNative = require('react-native');

const { AppCenterReactNative } = ReactNative.NativeModules;
const AppCenterLog = require('appcenter/appcenter-log');
const PackageJson = require('./package.json');

const logTag = 'AppCenter';

const AppCenter = {
    LogLevel: {
        VERBOSE: AppCenterLog.LogLevelVerbose,     // Logging will be very chatty
        DEBUG: AppCenterLog.LogLevelDebug,         // Debug information will be logged
        INFO: AppCenterLog.LogLevelInfo,           // Information will be logged
        WARNING: AppCenterLog.LogLevelWarning,     // Errors and warnings will be logged
        ERROR: AppCenterLog.LogLevelError,         // Errors will be logged
        ASSERT: AppCenterLog.LogLevelAssert,       // Only critical errors will be logged
        NONE: AppCenterLog.LogLevelNone            // Logging is disabled
    },

    /**
     * @deprecated Use `LogLevel.VERBOSE` instead.
     */
    LogLevelVerbose: AppCenterLog.LogLevelVerbose,

    /**
     * @deprecated Use `LogLevel.DEBUG` instead.
     */
    LogLevelDebug: AppCenterLog.LogLevelDebug,

    /**
     * @deprecated Use `LogLevel.INFO` instead.