Skip to content

fix: handle NFC deeplinks and clear Play Console warning - #1054

Merged
jvsena42 merged 5 commits into
masterfrom
fix/deeplink-not-working
Jul 15, 2026
Merged

fix: handle NFC deeplinks and clear Play Console warning#1054
jvsena42 merged 5 commits into
masterfrom
fix/deeplink-not-working

Conversation

@jvsena42

@jvsena42 jvsena42 commented Jun 29, 2026

Copy link
Copy Markdown
Member

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.handleDeeplinkIntent early-returned unless the intent action was ACTION_VIEW, but NFC tag taps arrive as android.nfc.action.NDEF_DISCOVERED with the tag URI in intent.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 reaches processDeeplink exactly 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 has ACTION_VIEW, and once in the NFC filter that uses NDEF_DISCOVERED. Because the NFC filter also carried BROWSABLE, Play's link crawler treated those schemes as browsable deep links missing an ACTION_VIEW action and flagged them. NFC tag dispatch matches on action and data only — the intent built by the platform's NfcDispatcher carries no categories, and startActivity adds only CATEGORY_DEFAULT — so BROWSABLE was never used there. Dropping it clears the false warning without affecting dispatch. The deep-link ACTION_VIEW filter 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-hunt is a server-side Digital Asset Links issue (the live assetlinks.json lists 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-3000

Manual Tests

  • 1. Tap an NFC gift card with a valid code → Bitkit opens and the Gift sheet appears with the claim proceeding.
  • 2. regression: Open a custom-scheme link (bitcoin: / lightning: / lnurl / bitkit://) from another app → Bitkit opens and routes to the correct flow.
  • 3. 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: added deeplink from NFC tag tap is processed (NDEF_DISCOVERED intent reaches processDeeplink) and intent without deeplink action is ignored (ACTION_MAIN is still dropped).
  • just test, just compile and detekt pass locally.

@jvsena42 jvsena42 self-assigned this Jun 29, 2026
@ovitrif ovitrif added this to the 2.4.0 milestone Jun 30, 2026
@piotr-iohk
piotr-iohk marked this pull request as ready for review July 9, 2026 10:33
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes NFC deeplink handling and cleans up the NFC intent filter.

  • Allows NFC tag taps using NDEF_DISCOVERED to reach deeplink processing.
  • Keeps unrelated launch actions from triggering deeplink handling.
  • Removes the unused BROWSABLE category from the NFC filter.
  • Adds tests for NFC deeplinks and ignored non-deeplink actions.
  • Adds a changelog entry for the fix.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

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

Comment thread app/src/main/AndroidManifest.xml
@jvsena42
jvsena42 marked this pull request as draft July 14, 2026 11:14
@jvsena42

Copy link
Copy Markdown
Member Author

Still need a deeper self review

@jvsena42 jvsena42 changed the title fix: clear Play Console NFC scheme warning fix: handle NFC deeplinks and clear Play Console warning Jul 14, 2026
@jvsena42
jvsena42 marked this pull request as ready for review July 14, 2026 17:18

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt
@jvsena42
jvsena42 enabled auto-merge July 14, 2026 17:35
@jvsena42
jvsena42 requested a review from piotr-iohk July 14, 2026 17:36

@piotr-iohk piotr-iohk left a comment

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.

tACK

Ran each command in three app states: not running, background, foreground.

  1. 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

  1. 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

  1. 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.

@jvsena42
jvsena42 merged commit 640ed43 into master Jul 15, 2026
18 checks passed
@jvsena42
jvsena42 deleted the fix/deeplink-not-working branch July 15, 2026 09:31
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.

3 participants