handlePush() { PushNotification.localNotification({ title: 'my title', message: 'lorem ipsum dolor' }); }
socket.on('inc_notif', (data) => { PushNotification.localNotification({ message: 'It is your turn to buy: \n' + data.quantity + ' of ' + data.resource }); PushNotification.setApplicationIconBadgeNumber(1) Alert.alert('It is your turn to buy: \n' + data.quantity + ' of ' + data.resource); socket.emit('received_notif', data); })
const onRemoteNotificationIos = notification => { console.log('onNotification', notification); if (!notification.data || !notification.data.data) { return; } const payload = notification.data.data.jsonBody; if (!payload) { return; } console.log('localNotification'); store.dispatch(newNotifications(payload)); RNPushNotification.localNotification({ id: '120', title: 'New Action', message: '', vibrate: true, }); }
RNPushNotification.localNotification({ id: NOTIFICATION_ID, title: title,
handleActionsPush() { PushNotification.localNotification({ title: 'Deseja mudar de view?', message: 'Escolha sim para acessar a home', actions: '["Yes", "No"]', }); }
const LocalNotification = (title, subText, message, bigText) => { PushNotification.localNotification({ autoCancel: true, bigText, subText, title, message, vibrate: true, vibration: 300, playSound: true, soundName: 'default', color: '#05A5D1', smallIcon: 'ic_launcher_transparent', largeIcon: 'ic_launcher_round', }); }