How to use react-native-in-app-notification - 2 common examples

To help you get started, we’ve selected a few react-native-in-app-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 berty / berty / js / packages / components / NotificationProvider.tsx View on Github external
import React from 'react'
import { InAppNotificationProvider, withInAppNotification } from 'react-native-in-app-notification'

import { messenger as messengerpb } from '@berty-tech/api/index.js'
import { useMsgrContext } from '@berty-tech/store/hooks'

import NotificationBody from './NotificationBody'

const NotificationBridge: React.FC = withInAppNotification(({ showNotification }: any) => {
	const {
		addNotificationListener,
		removeNotificationListener,
		contacts,
		persistentOptions,
	} = useMsgrContext()

	React.useEffect(() => {
		const listener = (evt: any) => {
			const contact = Object.values(contacts).find(
				(c: any) => c.conversationPublicKey === evt.payload.publicKey,
			)
			const isValid =
				contact.state !== messengerpb.Contact.State.IncomingRequest &&
				contact.state !== messengerpb.Contact.State.Undefined
			// check if message comes from valid contact
github Vivify-Ideas / expo-boilerplate / screens / NetworkInterceptor.js View on Github external
/>
       handleSetGlobalError(false)} />
       handleSetSocialLoginError('')}
      />
    
  );
};

NetworkInterceptor.propTypes = {
  children: PropTypes.any,
  showNotification: PropTypes.func
};

export default withInAppNotification(NetworkInterceptor);

const styles = StyleSheet.create({
  container: {
    backgroundColor: '#fff',
    flex: 1
  }
});

react-native-in-app-notification

Customisable in-app notification component for React Native

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular react-native-in-app-notification functions