Skip to content

Commit 3320ecb

Browse files
committed
Make sure to also fetch last notification response
If not tap might be missed
1 parent aa4aad1 commit 3320ecb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/expo/src/modules/push/KnockExpoPushNotificationProvider.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,16 @@ const InternalKnockExpoPushNotificationProvider: React.FC<
227227
notificationReceivedHandler(notification);
228228
});
229229

230+
const response = Notifications.getLastNotificationResponse();
231+
if (response?.notification) {
232+
knockClient.log("[Knock] Expo Push Notification was interacted with");
233+
updateKnockMessageStatusFromNotification(
234+
response.notification,
235+
"interacted",
236+
);
237+
notificationTappedHandler(response);
238+
}
239+
230240
const notificationResponseSubscription =
231241
Notifications.addNotificationResponseReceivedListener((response) => {
232242
knockClient.log("[Knock] Expo Push Notification was interacted with");

0 commit comments

Comments
 (0)