Skip to content

feat: Handle deep links#334

Merged
m1sterc001guy merged 5 commits intofedimint:masterfrom
NateMoeller:deeplinks
Jan 19, 2026
Merged

feat: Handle deep links#334
m1sterc001guy merged 5 commits intofedimint:masterfrom
NateMoeller:deeplinks

Conversation

@NateMoeller
Copy link
Copy Markdown
Contributor

@NateMoeller NateMoeller commented Dec 14, 2025

Opens the following types of links

  • bicoin:
  • lightning:
  • lnurl:
  • lnurlp:

Testing:

  • Cold start with lightning: invoice
  • Cold start with lnurl:
  • Cold start with bitcoin: address
  • Cold start with lnurlp:
  • Warm start (app in background) with lightning: invoice
  • Warm start with lnurl:
  • Warm start with bitcoin: address
  • Deep link with single federation (no picker needed)
  • Deep link with multiple federations (picker shown)
  • Invalid/malformed deep link (show error toast)

@m1sterc001guy
Copy link
Copy Markdown
Collaborator

How have you been testing? Will this work with BIP321 URIs?

@NateMoeller
Copy link
Copy Markdown
Contributor Author

I've been throwing links in a url shortening service (tinyurl.com), and clicking on them from my phone and opening with ecash app. And yes it should work with BIP321 URIs.

@NateMoeller NateMoeller marked this pull request as ready for review December 17, 2025 20:26
Comment thread .github/workflows/test.yml Outdated
@@ -0,0 +1,193 @@
import 'package:ecashapp/deep_link_handler.dart';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do I run these tests locally? Can you add a just command for doing that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added just test command

Comment thread pubspec.lock
Comment on lines +36 to +51
app_links_platform_interface:
dependency: transitive
description:
name: app_links_platform_interface
sha256: "05f5379577c513b534a29ddea68176a4d4802c46180ee8e2e966257158772a3f"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
app_links_web:
dependency: transitive
description:
name: app_links_web
sha256: af060ed76183f9e2b87510a9480e56a5352b6c249778d07bd2c95fc35632a555
url: "https://pub.dev"
source: hosted
version: "1.0.4"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need these two? We don't support the web

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, I think these are required

@m1sterc001guy
Copy link
Copy Markdown
Collaborator

Needs rebase

Opens the following types of links
 - bicoin:
 - lightning:
 - lnurl:
 - lnurlp:
 - lnurlw:
Comment thread lib/app.dart
Comment on lines +298 to +341
final result = await parseScannedTextForFederation(
text: deepLink.data,
federation: fed,
);

final action = result.$1;

switch (action) {
case ParsedText_LightningInvoice(:final field0):
// Show payment preview for BOLT11 invoice
if (!mounted) return;
await showAppModalBottomSheet(
context: context,
childBuilder: () async {
final preview = await paymentPreview(
federationId: fed.federationId,
bolt11: field0,
);
return PaymentPreviewWidget(
fed: fed,
paymentPreview: preview,
);
},
);
_onJoinPressed(fed, false);
break;

case ParsedText_LightningAddressOrLnurl(:final field0):
// For LNURL/Lightning Address, go to number pad for amount entry
final btcPrices = await fetchAllBtcPrices();
if (!mounted) return;
await Navigator.push(
context,
MaterialPageRoute(
builder: (_) => NumberPad(
fed: fed,
paymentType: PaymentType.lightning,
btcPrices: btcPrices,
onWithdrawCompleted: null,
lightningAddressOrLnurl: field0,
),
),
);
break;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This logic looks very similar to what we have in scan.dart. They're in different contexts though so I don't see an easy way to unify the logic.

Copy link
Copy Markdown
Collaborator

@m1sterc001guy m1sterc001guy left a comment

Choose a reason for hiding this comment

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

Ok, I have tested this! I tried:

bitcoin:
lightning:
lnurl:
lnurlp:
lnurlw:

They all work! The one weird one is lnurlw though. In the app, that one is handled identically to lnurl and lnurlp, which I think is wrong. I don't think we support LNURL withdraw currently. We could support it by handling lnurlw and generating an invoice in response, but we don't do this currently. I think we should just remove lnurlw for now.

Otherwise LGTM, I say we merge after we remove lnurlw.

@m1sterc001guy m1sterc001guy merged commit 1dbbb19 into fedimint:master Jan 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants