Scanning NFC tags always produces "Open Link?" confirmation pop-up (is it a bug?)
See original GitHub issueHome Assistant Android version: 2.3.0-306-full Android version: 10 Phone model: Pixel 2 Home Assistant version: 0.114.4 Last working Home Assistant release (if known): N/A Description of problem: Not sure if it’s a bug or not, but any time I scan an NFC tag, I get a confirmation dialog titled “Open Link?”. I have the option to “Cancel” or “Open link”. When I tap “Open link”, an intent appears that’s clearly part of Home Assistant app, and the event fires successfully.
My expectation (or rather, my “hope”) is that if my phone is unlocked, I should be able to scan a tag, and have the event fire without any interaction from me.
I’m guessing this is a security measure on Android that can’t be disabled, but I thought I would post the issue in the hopes that it’s something that can be changed.
Traceback (if applicable):
Screenshot of problem: Additional information: I’ve verified that the “Open by default” settings show that opening links is set to open in the app, and that "www.home-assistant.io is listed as a supported link (see screenshot)
Issue Analytics
- State:
- Created 3 years ago
- Comments:47 (16 by maintainers)
Top GitHub Comments
It’s worth noting this only happens with https urls (home assistant related or not). If I write another NFC tag with a custom scheme (
homeassistanttestapp://tag/abc-def-etc
) then it goes straight to the application, without interception. I wonder if it would be worth adding a configuration to do the universal NFC links or a custom scheme.I think I have it working for both Android and IOS, no pop-ups. So on Android I downloaded an app called NFC Tag Writer and it has an option to read a tag, save it in a local data store and then write it back. I wrote the tag written by HA back to another NFC tag and then used the saved link in ‘My datasets’ to write a clone of the tag. I then added an application via the checkbox in the datastore ‘Add launch application’ to launch to the tag. This appears to have added 52 bytes of metadata which shows HA as the launch app. When I now tap that tag, it works without the popup. It also works on IOS.
I suspect we just need to see if the HA tag writer can add this additional metadata when writing the tag.
FYI: This is an NFC AAR record.