HomePhabricator
Diffusion Comm 02c05d9f0771

[native] Refactor the deep links context provider to support both invite links…

Description

[native] Refactor the deep links context provider to support both invite links and QR code links

Summary:
This diff handles moving all of the deep link handling logic into the one. The main thing here is we use both parse methods (parseSecretFromInviteLinkURL and parseKeysFromQRCodeURL) on the current link, and then handle what to do based on whether the regex finds a match. We check for the invite link first because it is possible in theory for there to be an invite link like /invite/qr-code/ if the community is called qr-code, but it's not really possible for the QR code link to contain an invite route.

This is not part of a monthly goal, just a follow-up task.

Depends on D9027

Part of ENG-4810

Test Plan:
Confirmed the following:

  • While the app is open, click on an invite link and confirm that Comm opens and the invite link modal appears to verify it
  • While the app is closed, click on the invite link and confirm that Comm opens and the invite link modal appears to verify it
  • While the app is not logged in, click on the invite link and confirm that Comm opens and following a successful login, the invite link modal appears to verify it
  • While the app is open, scan the login QR code in my iOS camera and confirm that Comm opens and navigates to the scanner
  • While the app is closed, scan the login QR code in my iOS camera and confirm that Comm opens and then navigates to the scanner
  • While the app is not logged in, scan the login QR code in my iOS camera and confirm that Comm opens, and following a login, navigates to the scanner
  • Made sure that invite links don't open the barcode scanner
  • Made sure that scanning a QR code doesn't prompt any invite link modals

Also following the React Navigation docs, I ran the following:

  • npx uri-scheme open "comm://invite/121313" --ios and confirmed that Comm opened and prompted the invite link modal
  • npx uri-scheme open "comm://qr-code/121313" --ios and confirmed that Comm opened and opened the barcode scanner

Reviewers: tomek, ginsu, atul

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D9028

Details