From fe61d3428b87a0caecbb3f9bc94b337fcfbf3a9f Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Tue, 6 Feb 2018 15:57:03 -0200 Subject: [PATCH] Fix push for iOS --- app/push.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/push.js b/app/push.js index 6c0687d8..2a8de1ff 100644 --- a/app/push.js +++ b/app/push.js @@ -4,11 +4,13 @@ import EJSON from 'ejson'; import { goRoom } from './containers/routes/NavigationService'; const handleNotification = (notification) => { - if (notification.usernInteraction) { + if (!notification.userInteraction) { return; } - const { rid, name } = EJSON.parse(notification.ejson); - return rid && name && goRoom({ rid, name }); + const { + rid, name, sender, type + } = EJSON.parse(notification.ejson || notification.data.ejson); + return rid && goRoom({ rid, name: type === 'd' ? sender.username : name }); }; PushNotification.configure({