Windows App: ProximityDevice NFC events not triggered / NFC doesn't work at all
was first posted as issue here: https://github.com/microsoft/microsoft-ui-xaml/issues/9358
Describe the bug
We have an app that we migrated from UWP to WinUI 3 a while ago.
Unfortunately, we discovered that with the WinUI 3 app the ProximityDevice NFC feature no longer triggers events / no longer works at all.
We use simple code that can be found in many examples and have set
<DeviceCapability Name="proximity"/>
var proximityDevice = Windows.Networking.Proximity.ProximityDevice.GetDefault();
var messageSubscriptionId = proximityDevice.SubscribeForMessage("NDEF", (device, message) =>
{
Console.WriteLine(message.Data.ToArray());
});
this works in UWP and doesn't work in WinUI3 App
See min Repo examples
Works: https://github.com/minze-it/BlankProximityUWP
Doesn't work: https://github.com/minze-it/BlankProximityMaui
Steps to reproduce the bug
- Start min repo apps
- Click Button
- Try read a NDEF 213/215/216 Tag which contains a NDEF message
Expected behavior
SubscribeForMessage delegate handler is invoked NuGet package version
WinUI 3 - Windows App SDK 1.4.5: 1.4.240411001 Windows version
Windows 11 (22H2): Build 22621, Windows 11 (21H2): Build 22000
---What do I need to do to use NFC in a WindowsAppSDK app, or where should I report a bug for errors affecting Windows.Networking.Proximity?