-
Notifications
You must be signed in to change notification settings - Fork 1
Deeplinks #390
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
Deeplinks #390
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements deeplink handling functionality for the Bitcoin wallet app, allowing users to initiate payments and other actions through external links and QR codes. The implementation includes support for various schemes including bitcoin, lightning, and LNURL protocols.
- Adds deeplink intent handling in the main activity for both app launch and new intents
- Integrates deeplink processing with existing scan/payment flow via the AppViewModel
- Updates the send confirmation screen to display node syncing state when the Lightning node is not running
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/AndroidManifest.xml | Adds intent filters for deeplinks, universal links, and NFC support with various Bitcoin/Lightning schemes |
| app/src/main/java/to/bitkit/ui/MainActivity.kt | Integrates deeplink handling in onCreate and onNewIntent methods |
| app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt | Implements deeplink processing logic and extracts screen transition delay constant |
| app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt | Passes node running state to the send confirmation screen |
| app/src/main/java/to/bitkit/ui/screens/wallets/send/SendConfirmScreen.kt | Conditionally displays sync view when node is not running and refactors content layout |
app/src/main/java/to/bitkit/ui/screens/wallets/send/SendConfirmScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/to/bitkit/ui/screens/wallets/send/SendConfirmScreen.kt
Dismissed
Show dismissed
Hide dismissed
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
app/src/main/java/to/bitkit/ui/screens/wallets/send/SendConfirmScreen.kt
Fixed
Show fixed
Hide fixed
|
Still trying to setup LNURL server |
|
doesn't recognize lnurl schemes Screen_recording_20250918_135353.webm |
|
drafted to check E2E tests |
|
@jvsena42 Can I review this? |
Yes, updating... |
ovitrif
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM & works
Tested on Pixel phone with adb:
adb shell am start -W -a android.intent.action.VIEW -d "<deeplink>" to.bitkit.dev
| private fun processDeeplink(uri: Uri) = viewModelScope.launch { | ||
| if (!walletRepo.walletExists()) return@launch | ||
|
|
||
| val data = uri.toString() | ||
| delay(SCREEN_TRANSITION_DELAY_MS) | ||
| handleScan(data.removeLightningSchemes()) | ||
| } | ||
|
|
||
| // Todo Temporaary fix while these schemes can't be decoded | ||
| private fun String.removeLightningSchemes(): String { | ||
| return this | ||
| .replace("lnurl:", "") | ||
| .replace("lnurlw:", "") | ||
| .replace("lnurlc:", "") | ||
| .replace("lnurlp:", "") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: don't really need a separate processDeeplink and removeLightningSchemes functions, would've been ok all in one, probably a bit less code in this class which is already having too many lines of code 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented it like this because removeLightningSchemes should be removed in the future
| private const val TEN_USD = 10 | ||
| private const val MAX_BALANCE_FRACTION = 0.5 | ||
| private const val MAX_FEE_AMOUNT_RATIO = 0.5 | ||
| private const val SCREEN_TRANSITION_DELAY_MS = 300L |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: already having this constant defined in TRANSITION_SCREEN_MS:
| const val TRANSITION_SCREEN_MS = AnimationConstants.DefaultDurationMillis.toLong() // 300ms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll update in #406

Description
Implement deeplink handling
Preview
zero_amount.mp4
with_amount.mp4
only_lightning.mp4
not_initialized_zero_amount.mp4
not_initialized_with_amount.mp4
no_wallet.mp4
Screen_recording_20250918_141851.webm
Screen_recording_20250918_142616.webm
Screen_recording_20250918_142641.webm
QA Notes
Scan a qr code or clink in a URI with the scheme: