Page MenuHomePhabricator

[native] Handle invite links in chats
ClosedPublic

Authored by tomek on Jul 26 2023, 2:29 AM.
Tags
None
Referenced Files
F3524902: D8637.id29049.diff
Mon, Dec 23, 3:02 PM
F3524382: D8637.diff
Mon, Dec 23, 12:30 PM
Unknown Object (File)
Sat, Nov 23, 4:25 PM
Unknown Object (File)
Sat, Nov 23, 4:25 PM
Unknown Object (File)
Sat, Nov 23, 4:25 PM
Unknown Object (File)
Sat, Nov 23, 4:25 PM
Unknown Object (File)
Sat, Nov 23, 4:25 PM
Unknown Object (File)
Nov 21 2024, 9:12 AM
Subscribers

Details

Summary

Currently, clicking the link results in opening a popup and then a page in Safari. This seems to be a feature of iOS https://linear.app/comm/issue/ENG-4408#comment-a667ee51.

This diff fixes the issue by checking if a link is an invite link and overriding the default behavior. Instead of showing a popup, we're calling the same function that is called when deep links are clicked. But in order to do that we need to replace our handler with a context so that this function becomes accessible outside it.

https://linear.app/comm/issue/ENG-4408/opening-invite-link-from-ios-app-opens-safari

Test Plan

Send a message with https://comm.app/invite/secret and check if clicking the link results in link modal being shown.
Check if links with other urls, e.g. https://comm.app still work as previously.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/root.react.js
253–255 ↗(On Diff #29042)

We have to put it below NavigationContainer because we're using useNavigation inside it.

Harbormaster returned this revision to the author for changes because remote builds failed.Jul 26 2023, 2:40 AM
Harbormaster failed remote builds in B21205: Diff 29042!
tomek requested review of this revision.Jul 26 2023, 3:27 AM
This revision is now accepted and ready to land.Jul 26 2023, 3:56 AM
This revision was automatically updated to reflect the committed changes.