How to use the react-native-onesignal.clearOneSignalNotifications function in react-native-onesignal

To help you get started, we’ve selected a few react-native-onesignal 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 pmusaraj / discourse-mobile-single-site-app / js / App.js View on Github external
componentDidMount() {
    OneSignal.addEventListener('ids', this.onIds);
    OneSignal.addEventListener('opened', this._onOpened.bind(this));
    OneSignal.inFocusDisplaying(global.inAppNotification);

    AppState.addEventListener('change', this._handleAppStateChange);

    // Android only: clear notifications (badge count) when user is in app
    if (Platform.OS !== 'ios') {
      OneSignal.clearOneSignalNotifications();
    }

    AsyncStorage.getItem('@Discourse.skipLogin').then(json => {
      if (json && json === 'loginSkipped') {
        this.setState({skipLogin: true});
      }
    });

    this.keyboardDidShowListener = Keyboard.addListener(
      'keyboardDidShow',
      this._keyboardDidShow.bind(this),
    );
    this.keyboardDidHideListener = Keyboard.addListener(
      'keyboardDidHide',
      this._keyboardDidHide.bind(this),
    );
github hummingbird-me / kitsu-mobile / src / screens / Notifications / NotificationsScreen / index.js View on Github external
componentDidAppear() {
    // Everytime user shows notifications tab, clear them
    OneSignal.clearOneSignalNotifications();
  }
github pmusaraj / discourse-mobile-single-site-app / js / App.js View on Github external
_handleAppStateChange = nextAppState => {
    console.log('APPSTATE: ' + nextAppState);
    if (
      this.state.appState.match(/inactive|background/) &&
      nextAppState === 'active'
    ) {
      if (Platform.OS !== 'ios') {
        OneSignal.clearOneSignalNotifications();
      }
    }
    this.setState({appState: nextAppState});
  };
github hummingbird-me / kitsu-mobile / src / screens / Notifications / NotificationsScreen / index.js View on Github external
onMarkAll = async () => {
    OneSignal.clearOneSignalNotifications();
    await this.props.markAllNotificationsAsRead();
    this.updateNotificationCount();
  };