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); })