Skip to content

feat: add new domain deeplinks #15467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Jun 12, 2025
Merged

feat: add new domain deeplinks #15467

merged 38 commits into from
Jun 12, 2025

Conversation

frankvonhoven
Copy link
Contributor

@frankvonhoven frankvonhoven commented May 19, 2025

Description

This is to prepare for adding new public universal links to the app to be triggered by a new domain.
This adds 3 routes: home, swap, and ramp (buy) for the new domain

There are currently blockers for making this functional in the app - 5/21/25

Related issues

Manual testing steps

  1. Run the app on this branch with a expo development build from Bitrise
  2. Click on each of these links in the Notes app or Slack these links to yourself

Home

https://metamask.app.link/home

Ramp - Buy

https://link-test.metamask.io/buy-crypto?chainId=59144&address=0x176211869cA2b568f2A7D4EE941E073a821EE1ff&amount=100

Swap

https://link-test.metamask.io/swap?from=eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&to=eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7&value=0x38d7ea4c68000
3. App should open to the appropriate screen

Screenshots/Recordings

/home

deeplink-home.mp4

/swap

deeplink-swap.mp4

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label May 19, 2025
This was linked to issues May 19, 2025
Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided a few pieces of specific feedback. You are also missing unit testing.

@frankvonhoven frankvonhoven self-assigned this May 22, 2025
@frankvonhoven frankvonhoven added the No QA Needed Apply this label when your PR does not need any QA effort. label May 22, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 12.82051% with 34 lines in your changes missing coverage. Please review.

Project coverage is 69.21%. Comparing base (e095d11) to head (0d758d5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/core/DeeplinkManager/Handlers/handleSwapUrl.ts 4.76% 20 Missing ⚠️
...eeplinkManager/ParseManager/handleUniversalLink.ts 21.42% 10 Missing and 1 partial ⚠️
app/core/DeeplinkManager/DeeplinkManager.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15467      +/-   ##
==========================================
- Coverage   69.25%   69.21%   -0.05%     
==========================================
  Files        2434     2435       +1     
  Lines       52417    52452      +35     
  Branches     7930     7937       +7     
==========================================
+ Hits        36304    36306       +2     
- Misses      13786    13818      +32     
- Partials     2327     2328       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@frankvonhoven frankvonhoven marked this pull request as ready for review May 22, 2025 21:23
@frankvonhoven frankvonhoven requested a review from a team May 22, 2025 21:23
@frankvonhoven frankvonhoven added the No E2E Smoke Needed If the PR does not need E2E smoke test run label May 22, 2025
@NicolasMassart NicolasMassart requested a review from Copilot June 9, 2025 09:20
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for a new public deeplink domain (link.metamask.io and link-test.metamask.io) by updating platform configs, routing constants, and deeplink handling logic for the home, swap, and ramp screens.

  • Add new universal link domains in iOS entitlements and plist, plus Android manifest intent filters
  • Introduce AppConstants for the new hosts and extend ACTIONS enum with HOME and SWAP
  • Implement new handling in handleUniversalLink, add handleSwapUrl handler, and cover with tests

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ios/MetaMask/MetaMaskDebug.entitlements Whitelist new applinks domains for debug builds
ios/MetaMask/MetaMask.entitlements Whitelist new applinks domains for production builds
ios/MetaMask/MetaMask-Flask-Info.plist Add new branch universal link domains
ios/MetaMask/Info.plist Add new branch universal link domains
android/app/src/main/AndroidManifest.xml Add intent filters for new universal link domains
app/core/AppConstants.ts Define MM_IO_UNIVERSAL_LINK_HOST and MM_IO_UNIVERSAL_LINK_TEST_HOST
app/constants/deeplinks.ts Add HOME and SWAP to ACTIONS and PREFIXES
app/core/DeeplinkManager/ParseManager/handleUniversalLink.ts Extend logic to route /home, /swap, and /buy-crypto on new domains
app/core/DeeplinkManager/ParseManager/handleUniversalLink.test.ts Add tests for new domain actions
app/core/DeeplinkManager/Handlers/handleSwapUrl.ts New handler to parse swap query params and navigate accordingly
app/core/DeeplinkManager/Handlers/handleSwapUrl.test.ts Unit tests for swap URL handler
app/core/DeeplinkManager/DeeplinkManager.ts Add _handleOpenHome and _handleSwap methods

Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests names are not matching our guidelines.

@github-project-automation github-project-automation bot moved this from Needs dev review to Needs more work from the author in PR review queue Jun 9, 2025
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it now!

@github-project-automation github-project-automation bot moved this from Needs more work from the author to Review finalised - Ready to be merged in PR review queue Jun 11, 2025
@frankvonhoven frankvonhoven added this pull request to the merge queue Jun 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 11, 2025
@frankvonhoven frankvonhoven added this pull request to the merge queue Jun 11, 2025
@frankvonhoven frankvonhoven removed this pull request from the merge queue due to a manual request Jun 11, 2025
Copy link

@frankvonhoven frankvonhoven enabled auto-merge June 11, 2025 23:54
@frankvonhoven frankvonhoven added this pull request to the merge queue Jun 11, 2025
Merged via the queue into main with commit 3f1447f Jun 12, 2025
41 checks passed
@frankvonhoven frankvonhoven deleted the add/new-domain-deeplinks-1 branch June 12, 2025 00:13
@github-project-automation github-project-automation bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue Jun 12, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2025
@metamaskbot metamaskbot added the release-7.50.0 Issue or pull request that will be included in release 7.50.0 label Jun 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No E2E Smoke Needed If the PR does not need E2E smoke test run No QA Needed Apply this label when your PR does not need any QA effort. release-7.50.0 Issue or pull request that will be included in release 7.50.0 team-mobile-platform Mobile Platform team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Deeplink to Home Deeplinking - Swap
7 participants