fix: handle NFC deeplinks and clear Play Console warning - #1054
Conversation
Greptile SummaryThis PR fixes NFC deeplink handling and cleans up the NFC intent filter.
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| app/src/main/AndroidManifest.xml | Removes BROWSABLE from the NFC NDEF_DISCOVERED filter while leaving normal deeplink filters unchanged. |
| app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt | Accepts both app/browser deeplink intents and NFC deeplink intents before processing intent data. |
| app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt | Adds tests for NFC deeplink processing and ignored non-deeplink actions. |
| changelog.d/next/1054.fixed.md | Documents the NFC deeplink fix and Play Console warning cleanup. |
Reviews (2): Last reviewed commit: "chore: add changelog fragment for nfc de..." | Re-trigger Greptile
|
Still need a deeper self review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbf7acfde4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
piotr-iohk
left a comment
There was a problem hiding this comment.
tACK
Ran each command in three app states: not running, background, foreground.
- NFC deeplink (
NDEF_DISCOVERED) — primary fix
adb shell am start -a android.nfc.action.NDEF_DISCOVERED \
-d "$GIFT_URI" \
-n to.bitkit.dev/to.bitkit.ui.MainActivity→ gift flow opens in all states
- Regression (
ACTION_VIEW)
adb shell am start -a android.intent.action.VIEW \
-d "$GIFT_URI" \
-n to.bitkit.dev/to.bitkit.ui.MainActivity→ works as expected in all states
- Negative control (
ACTION_MAIN+LAUNCHER)
adb shell am start -a android.intent.action.MAIN \
-c android.intent.category.LAUNCHER \
-n to.bitkit.dev/to.bitkit.ui.MainActivity→ app opens normally, no deeplink/gift handling in all states
$GIFT_URI = bitkit://gift-<code>-<amount>, set locally.
Gift code was already claimed on the test wallet, so claim ended in “already used” — still confirms routing works end-to-end.
Fixes NFC tag taps being silently ignored, so the gift-card tap flow works, and clears the Google Play Console Deep Links warning "Add an ACTION_VIEW intent action attribute to the intent filter" raised against
BITCOIN://and nearly all other custom schemes.Description
NFC deep links were never handled.
AppViewModel.handleDeeplinkIntentearly-returned unless the intent action wasACTION_VIEW, but NFC tag taps arrive asandroid.nfc.action.NDEF_DISCOVEREDwith the tag URI inintent.data. The manifest advertised an NFC entry point that the code then dropped on the floor: tapping a gift card launched Bitkit and nothing happened. The guard now accepts both actions, so a tapped tag reachesprocessDeeplinkexactly like a link opened from another app. Non-deeplink actions (e.g.ACTION_MAIN) are still ignored.Play Console warning. The custom schemes (
bitcoin,bitkit,lightning,lnurl*, etc.) are declared twice: once in the deep-link filter that already hasACTION_VIEW, and once in the NFC filter that usesNDEF_DISCOVERED. Because the NFC filter also carriedBROWSABLE, Play's link crawler treated those schemes as browsable deep links missing anACTION_VIEWaction and flagged them. NFC tag dispatch matches on action and data only — the intent built by the platform'sNfcDispatchercarries no categories, andstartActivityadds onlyCATEGORY_DEFAULT— soBROWSABLEwas never used there. Dropping it clears the false warning without affecting dispatch. The deep-linkACTION_VIEWfilter and the autoVerify App Links filter are unchanged.This addresses only the custom-scheme warning. The separate "domain failed validation" error for
https://www.bitkit.to/treasure-huntis a server-side Digital Asset Links issue (the liveassetlinks.jsonlists the wrong package) and is tracked in synonymdev/synonym-website#245.Preview
read-nfc-card.mp4
from-browser.webm
QA Notes
tested with this (expired) URI
bitkit://gift-3k05052026joao-3000Manual Tests
regression:Open a custom-scheme link (bitcoin:/lightning:/lnurl/bitkit://) from another app → Bitkit opens and routes to the correct flow.regression:Launch Bitkit from the launcher icon → no deeplink handling is triggered.An NFC tap can be simulated without a physical tag:
adb shell am start -a android.nfc.action.NDEF_DISCOVERED -d "bitkit://gift-3k05052026joao-3000"Automated Checks
AppViewModelSendFlowTest.kt: addeddeeplink from NFC tag tap is processed(NDEF_DISCOVERED intent reachesprocessDeeplink) andintent without deeplink action is ignored(ACTION_MAINis still dropped).just test,just compileand detekt pass locally.