How to use the appcenter-push.setEnabled function in appcenter-push

To help you get started, we’ve selected a few appcenter-push 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 / DemoApp / app / screens / AppCenterScreen.js View on Github external
toggle: async () => {
                    await Push.setEnabled(!this.state.pushEnabled);
                    const pushEnabled = await Push.isEnabled();
                    this.setState({ pushEnabled });
                  }
                },
github microsoft / appcenter-sdk-react-native / TestAppTypescript / src / PushScreen.tsx View on Github external
async toggleEnabled() {
    await Push.setEnabled(!this.state.pushEnabled);

    const pushEnabled = await Push.isEnabled();
    this.setState({ pushEnabled });
  }
github microsoft / appcenter-sdk-react-native / TestApp34 / PushScreen.js View on Github external
async toggleEnabled() {
    await Push.setEnabled(!this.state.pushEnabled);

    const pushEnabled = await Push.isEnabled();
    this.setState({ pushEnabled });
  }
github esteemapp / esteem-mobile / src / screens / settings / container / settingsContainer.js View on Github external
Object.keys(notificationDetails).map(item => {
      const notificationType = item.replace('Notification', '');

      if (notificationType === actionType.replace('notification.', '')) {
        if (action) {
          notifyTypes.push(notifyTypesConst[notificationType]);
        }
      } else if (notificationDetails[item]) {
        notifyTypes.push(notifyTypesConst[notificationType]);
      }
    });
    notifyTypes.sort();

    if (actionType === 'notification') {
      await Push.setEnabled(action);
      this._setPushToken(action ? notifyTypes : []);
    } else {
      this._setPushToken(notifyTypes);
    }
  };
github microsoft / appcenter-sdk-react-native / TestApp / app / screens / AppCenterScreen.js View on Github external
toggle: async () => {
                    await Push.setEnabled(!this.state.pushEnabled);
                    const pushEnabled = await Push.isEnabled();
                    this.setState({ pushEnabled });
                  }
                },
github esteemapp / esteem-mobile / src / screens / application / container / applicationContainer.js View on Github external
);
      this.setState({ isThemeReady: true });
      if (settings.isPinCodeOpen !== '') dispatch(isPinCodeOpen(settings.isPinCodeOpen));
      if (settings.language !== '') dispatch(setLanguage(settings.language));
      if (settings.server !== '') dispatch(setApi(settings.server));
      if (settings.upvotePercent !== '') {
        dispatch(setUpvotePercent(Number(settings.upvotePercent)));
      }
      if (settings.isDefaultFooter !== '') dispatch(isDefaultFooter(settings.isDefaultFooter));
      if (settings.notification !== '') {
        dispatch(
          changeNotificationSettings({ type: 'notification', action: settings.notification }),
        );
        dispatch(changeAllNotificationSettings(settings));

        Push.setEnabled(settings.notification);
      }
      if (settings.nsfw !== '') dispatch(setNsfw(settings.nsfw));

      if (settings.currency !== '') {
        dispatch(setCurrency(settings.currency !== '' ? settings.currency : 'usd'));
      }
    }
  };
github microsoft / appcenter-sdk-react-native / TestApp / PushScreen.js View on Github external
async toggleEnabled() {
    await Push.setEnabled(!this.state.pushEnabled);

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

appcenter-push

React Native plugin for AppCenter Push

MIT
Latest version published 4 years ago

Package Health Score

52 / 100
Full package analysis