How to use the appcenter.setUserId function in appcenter

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
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 / TestApp / app / screens / AppCenterScreen.js View on Github external
}
    }

    const appSecretKey = await AsyncStorage.getItem(APP_SECRET);
    for (let index = 0; index < AppSecrets.length; index++) {
      const appSecret = AppSecrets[index];
      if (appSecret.key === appSecretKey) {
        this.state.appSecret = appSecret;
        break;
      }
    }

    const userId = await AsyncStorage.getItem(USER_ID_KEY);
    if (userId !== null) {
      this.state.userId = userId;
      await AppCenter.setUserId(userId);
    }
    this.props.navigation.setParams({
      refreshAppCenterScreen: this.refreshUI.bind(this)
    });

    await AppCenter.setLogLevel(AppCenter.LogLevel.VERBOSE);
  }
github microsoft / appcenter-sdk-react-native / DemoApp / app / screens / AppCenterScreen.js View on Github external
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;
      }
    }
    const userId = await AsyncStorage.getItem(USER_ID_KEY);
    if (userId !== null) {
      this.state.userId = userId;
      await AppCenter.setUserId(userId);
    }
    this.props.navigation.setParams({
      refreshAppCenterScreen: this.refreshUI.bind(this)
    });
  }