How to use the react-native-push-notification.onNotification function in react-native-push-notification

To help you get started, we’ve selected a few react-native-push-notification 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 alex-friedl / crossplatform-push-notifications-example / app / js / rn-push.js View on Github external
registerNotificationListener(listener) {
    if (Platform.OS === 'ios') {
      PushNotification.onNotification = (notification) => {
        listener(notification);
        notification.finish(PushNotificationIOS.FetchResult.NoData);
      };
    } else {
      PushNotification.onNotification = listener;
    }
  }