thunderbird / thunderbird-android

K-9 Mail – Open Source Email App for Android
https://k9mail.app/
Apache License 2.0
9.47k stars 2.42k forks source link

Add support for mailto: URI on NFC tag #7755

Closed hadmut closed 1 week ago

hadmut commented 4 weeks ago

Checklist

App version

6.801

Where did you get the app from?

Google Play

Android version

12 SKQ1.210908.001

Device model

Xiaomi Redmi Note 10 Pro

Steps to reproduce

  1. Get a physical RFID tag (e.g. NTAG213 or NTAG215 ...)
  2. Use the "NFC Tools" or "NFC Tools PRO" App to write some records like text, a phone-number, and an E-Mail-Adress on the tag. (The app automatically converts this to a list of URLs like phone: or mailto:
  3. hold the tag to a NFC-capable android phone with K-9 installed and configured with an account

Expected behavior

As soon as the phone (start screen, no app running, but NFC enabled in settings) gets contact to the tag, it beeps and presents a list of apps to launch, for each of the URLs the apps ready to process the given URL.

For e-mail-addresses, K-9 should appear in the list of apps.

Actual behavior

K-9 does not appear on the list of apps, while other do. Gmail appears. Just for testing, without ever opening or configuring them, other mail apps like Blue Mail or AquaMail get listed as well. Just not K-9. See the screenshot

60d0ee52e6740112d8b513b55a308a4c97df244c

Interestingly, opening a URL like mailto:abc@danisch.de through the chrome-browser works, K-9 is offered as a choice.

Logs

60d0ee52e6740112d8b513b55a308a4c97df244c

cketti commented 3 weeks ago

The default NFC tag reader app (on my Pixel 8) doesn't open a URI for viewing like e.g. a browser. It uses the ACTION_NDEF_DISCOVERED intent to notify interested apps that an NDEF record with a mailto URI was found. So this is a missing feature, not a bug.

To add support for this, an intent filter for the android.nfc.action.NDEF_DISCOVERED action has to be added to the manifest entry for MessageCompose. Then MessageCompose has to be updated to parse the mailto URI like it already does for ACTION_VIEW and ACTION_SENDTO.