From 27f4cc9f1ab1ee0e97bd287b58d8ff74a73bff19 Mon Sep 17 00:00:00 2001 From: Cristi Paval <cristi@expensify.com> Date: Tue, 14 Feb 2023 21:35:12 +0200 Subject: [PATCH 1/2] Save actions from push payload in Onyx. --- src/libs/Notification/PushNotification/index.native.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/libs/Notification/PushNotification/index.native.js b/src/libs/Notification/PushNotification/index.native.js index 4dc3ad1c3a8e..c24fbc00f3b3 100644 --- a/src/libs/Notification/PushNotification/index.native.js +++ b/src/libs/Notification/PushNotification/index.native.js @@ -57,13 +57,6 @@ function pushNotificationEventCallback(eventType, notification) { function init() { // Setup event listeners UrbanAirship.addListener(EventType.PushReceived, (notification) => { - // If a push notification is received while the app is in foreground, - // we'll assume pusher is connected so we'll ignore it and not fetch the same data twice. - if (AppState.currentState === 'active') { - Log.info('[PUSH_NOTIFICATION] Push received while app is in foreground, not executing any callback.'); - return; - } - pushNotificationEventCallback(EventType.PushReceived, notification); }); From 4f26429dc2928341f7ea7da7dac9c869ecb8c6b9 Mon Sep 17 00:00:00 2001 From: Cristi Paval <cristi@expensify.com> Date: Tue, 14 Feb 2023 23:05:54 +0200 Subject: [PATCH 2/2] Fix Lint error. --- src/libs/Notification/PushNotification/index.native.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/Notification/PushNotification/index.native.js b/src/libs/Notification/PushNotification/index.native.js index c24fbc00f3b3..006ed4b06a5e 100644 --- a/src/libs/Notification/PushNotification/index.native.js +++ b/src/libs/Notification/PushNotification/index.native.js @@ -1,5 +1,4 @@ import _ from 'underscore'; -import {AppState} from 'react-native'; import {UrbanAirship, EventType, iOS} from 'urbanairship-react-native'; import lodashGet from 'lodash/get'; import Log from '../../Log';