How to use the appcenter.getInstallId 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
async refreshUI() {
    const appCenterEnabled = await AppCenter.isEnabled();
    this.setState({ appCenterEnabled });

    const authEnabled = await Auth.isEnabled();
    this.setState({ authEnabled });

    const pushEnabled = await Push.isEnabled();
    this.setState({ pushEnabled });

    const installId = await AppCenter.getInstallId();
    this.setState({ installId });
  }
github microsoft / appcenter-sdk-react-native / TestAppTypescript / src / AppCenterScreen.tsx View on Github external
async componentDidMount() {
    const component = this;

    const appCenterEnabled = await AppCenter.isEnabled();
    component.setState({ appCenterEnabled });

    const installId = await AppCenter.getInstallId();
    component.setState({ installId });

    const logLevel = await AppCenter.getLogLevel();
    component.setState({ logLevel });
  }
github esteemapp / esteem-mobile / src / screens / settings / container / settingsContainer.js View on Github external
_setPushToken = async notifyTypes => {
    const { isLoggedIn, otherAccounts = [] } = this.props;

    if (isLoggedIn) {
      const token = await AppCenter.getInstallId();

      getExistUser().then(isExistUser => {
        if (isExistUser) {
          otherAccounts.forEach(item => {
            const { isNotificationSettingsOpen } = this.props;

            const data = {
              username: item.username,
              token,
              system: Platform.OS,
              allows_notify: Number(isNotificationSettingsOpen),
              notify_types: notifyTypes,
            };
            setPushToken(data);
          });
        }
github microsoft / appcenter-sdk-react-native / DemoApp / app / screens / AppCenterScreen.js View on Github external
async refreshUI() {
    const appCenterEnabled = await AppCenter.isEnabled();
    this.setState({ appCenterEnabled });

    const authEnabled = await Auth.isEnabled();
    this.setState({ authEnabled });

    const pushEnabled = await Push.isEnabled();
    this.setState({ pushEnabled });

    const installId = await AppCenter.getInstallId();
    this.setState({ installId });
  }
github esteemapp / esteem-mobile / src / screens / login / container / loginContainer.js View on Github external
_setPushToken = async username => {
    const { notificationSettings, notificationDetails } = this.props;
    const notifyTypesConst = {
      vote: 1,
      mention: 2,
      follow: 3,
      comment: 4,
      reblog: 5,
      transfers: 6,
    };
    const notifyTypes = [];
    const token = await AppCenter.getInstallId();

    Object.keys(notificationDetails).map(item => {
      const notificationType = item.replace('Notification', '');

      if (notificationDetails[item]) {
        notifyTypes.push(notifyTypesConst[notificationType]);
      }
    });

    const data = {
      username,
      token,
      system: Platform.OS,
      allows_notify: Number(notificationSettings),
      notify_types: notifyTypes,
    };
github microsoft / appcenter-sdk-react-native / TestApp34 / AppCenterScreen.js View on Github external
async componentDidMount() {
    const component = this;

    const appCenterEnabled = await AppCenter.isEnabled();
    component.setState({ appCenterEnabled });

    const installId = await AppCenter.getInstallId();
    component.setState({ installId });

    const logLevel = await AppCenter.getLogLevel();
    component.setState({ logLevel });
  }
github microsoft / appcenter-sdk-react-native / DemoApp / AppCenterScreen.js View on Github external
async componentDidMount() {
    const component = this;

    const appCenterEnabled = await AppCenter.isEnabled();
    component.setState({ appCenterEnabled });

    const installId = await AppCenter.getInstallId();
    component.setState({ installId });

    const logLevel = await AppCenter.getLogLevel();
    component.setState({ logLevel });
  }
github esteemapp / esteem-mobile / src / screens / application / container / applicationContainer.js View on Github external
_enableNotification = async (username, isEnable) => {
    const token = await AppCenter.getInstallId();

    setPushToken({
      username,
      token,
      system: Platform.OS,
      allows_notify: Number(isEnable),
      notify_types: [1, 2, 3, 4, 5, 6],
    });
  };