Can an app take priority over the system on tap?
Yes, while it is in the foreground. Android lets a foreground activity claim discovered tags ahead of the ordinary dispatch, which is exactly how a reading tool examines a tag instead of letting it open. In the background, no application can pre empt the system.
Foreground only
The Android documentation describes a foreground dispatch system that allows a foreground activity to have priority when a tag is discovered, and notes that it overrides the ordinary dispatch and application naming records.
The condition is doing the work: the application must be open and on screen. An application in the background has no such privilege.
This is why opening a reading tool changes what a tap does. The tool has claimed tags for as long as it is in front of you.
What it is used for
Reading tools, which need to examine a tag rather than trigger it. Without this, tapping a tag while trying to inspect it would open the tag instead.
Writing tools, for the same reason. Writing requires the application to hold the tag through the exchange.
Applications with their own tag flows, such as a stocktaking tool that expects a series of tags and wants each one handled internally.
In all three cases the point is the same: the application knows what it wants from the tag and the system's guess would be wrong.
What it cannot do
Claim tags in the background. Once the application is not in front of the user, the ordinary dispatch resumes.
Override another application that is itself in the foreground, since only one thing is in front at a time.
Change what happens on somebody else's phone. This is a capability of an installed application, so it is available for devices you control and irrelevant to a public deployment.
And it does not exist in this form on iOS, where reading is initiated by the application rather than intercepted from a system flow.
Consequences for a deployment
For tags in a controlled environment, an application in the foreground gives you exact control over what a tap does.
For tags in public, you have none. The phone belongs to someone else, and whatever they have installed and whatever is on screen decides the outcome.
Which brings the design back to a web address, since that behaves predictably whether an application is claiming tags or not.
And it explains a confusing test result: a tag that behaves one way with a reading tool open and another way from the home screen is behaving correctly in both cases.
Frequently asked questions
Why does my tag behave differently when a reading app is open?
Because a foreground application can claim tags ahead of the system. That is the mechanism reading and writing tools depend on.
Can an app claim tags in the background?
No. The privilege applies to a foreground activity, so a backgrounded application does not pre empt the ordinary dispatch.
Does this work on iPhone?
Not in this form. On iOS an application starts a reading session itself rather than intercepting a system flow.
Can I use this for a public deployment?
Only where you control the devices. On a visitor's phone you control the tag and nothing else.