Fix push for iOS

This commit is contained in:
Rodrigo Nascimento 2018-02-06 15:57:03 -02:00 committed by Guilherme Gazzo
parent 9f96136571
commit fe61d3428b
No known key found for this signature in database
GPG Key ID: 1F85C9AD922D0829
1 changed files with 5 additions and 3 deletions

View File

@ -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({