INNER CODE UNIT · JavaScript

mapNotifications

zo0r/react-native-push-notification · index.js:559

	const mapNotifications = (notifications) => {
		let mappedNotifications = [];
		if(notifications?.length > 0) {
			if(Platform.OS === 'ios'){
				mappedNotifications = notifications.map(notif => {
					return ({
						soundName: notif?.sound,
						id: notif.id,
                        date: (notif.date ? new Date(notif.date) : null),
						number: notif?.badge,
						message: notif?.body,
            title: notif?.title,
            data: notif?.userInfo
					})
				})
			} else if(Platform.OS === 'android') {
				mappedNotifications = notifications.map(notif => {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…