Skip to content

Commit

Permalink
fix: Correct iOS notification handling
Browse files Browse the repository at this point in the history
Also, catch data for diagnostics earlier
  • Loading branch information
borisyankov committed Mar 29, 2018
1 parent d627aa3 commit a2fc51b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/notifications.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ const onPushRegistered = async (
};

export const addNotificationListener = (notificationHandler: (notification: Object) => void) => {
NotificationsIOS.addEventListener('notificationOpened', notificationHandler);
NotificationsIOS.addEventListener('notification', notificationHandler);

This comment has been minimized.

};

export const removeNotificationListener = (notificationHandler: (notification: Object) => void) => {
NotificationsIOS.removeEventListener('notificationOpened', notificationHandler);
NotificationsIOS.removeEventListener('notification', notificationHandler);
};

export const initializeNotifications = (
Expand All @@ -41,12 +41,12 @@ export const initializeNotifications = (
export const refreshNotificationToken = () => {};

export const handlePendingNotifications = async (notificationData: Object, actions: Actions) => {
config.startup.notification = notificationData;
if (!notificationData || !notificationData.getData) {
return;
}

const data = notificationData.getData();
config.startup.notification = data;
if (!data || !data.custom || !data.custom.data) {
return;
}
Expand Down

0 comments on commit a2fc51b

Please sign in to comment.