Skip to content

Commit

Permalink
Merge pull request #7633 from Expensify/neil-ios-notifications-link
Browse files Browse the repository at this point in the history
Make push notifications navigate to the correct chat - iOS
  • Loading branch information
sketchydroide authored Feb 21, 2022
2 parents c873776 + 86f877f commit 75c7986
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,13 @@ function subscribeToReportCommentPushNotifications() {

// Open correct report when push notification is clicked
PushNotification.onSelected(PushNotification.TYPE.REPORT_COMMENT, ({reportID}) => {
Navigation.setDidTapNotification();
Linking.openURL(`${CONST.DEEPLINK_BASE_URL}${ROUTES.getReportRoute(reportID)}`);
if (Navigation.isReady()) {
Navigation.navigate(ROUTES.getReportRoute(reportID));
} else {
// Navigation container is not yet ready, use deep linking to open the correct report instead
Navigation.setDidTapNotification();
Linking.openURL(`${CONST.DEEPLINK_BASE_URL}${ROUTES.getReportRoute(reportID)}`);
}
});
}

Expand Down

0 comments on commit 75c7986

Please sign in to comment.