microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.85k stars 328 forks source link

ProximityDevice NFC events not triggered / NFC doesn't work at all #4356

Open baaaaif opened 7 months ago

baaaaif commented 7 months ago

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 WindowsAppSDK/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

Expected behavior

SubscribeForMessage delegate handler is invoked

Screenshots

No response

NuGet package version

Windows App SDK 1.5.2: 1.5.240404000

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

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?

DarranRowe commented 7 months ago

or where should I report a bug for errors affecting Windows.Networking.Proximity?

As Janine Zhang mentioned in the Q&A post and I actually mentioned in the post you originally posted on the Microsoft.UI.Xaml repository, you really should be reporting this using the Feedback Hub application that is part of Windows. This is where Windows related bug reports should go.

Screenshot 2024-04-19 120832

baaaaif commented 7 months ago

I did - from my private notebook... Not even a reaction or comment within nealy 2 month. Nothing. Nobody at Microsoft cares, like the old 3K closed "stale" issues in the WinUI xaml repository.

Business notebook: image

I'm going around in circles trying to find a contact person who is actually willing to deal with a reported problem. And our customer waits and waits for the feature to work again.

...instead of someone simply taking the courage to pass it on internally to the appropriate department

baaaaif commented 7 months ago

I think this repository is the right place image

DarranRowe commented 7 months ago

I think this repository is the right place

If you look around, then you will find that this is part of the footer for this template. It is even present for CoreApplicationView. This is telling for two reasons. 1) The Windows App SDK doesn't support UWP applications. 2) CoreApplicationView isn't available in desktop applications. This is documented too.

But I guess that right now you would need someone from Microsoft to comment on this issue.

minze-it commented 7 months ago
1. The Windows App SDK doesn't support UWP applications.

2. CoreApplicationView isn't available in desktop applications. This is [documented too](https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/desktop-to-uwp-supported-api#core-unsupported-classes).

Could you give us a more detailed explanation on those two reasons? It's not about UWP supporting WinAppSDK or not, It's about the Proximity Device as part of the WinRT-API that is working as part of a UWP-App but simply is not when used inside a WinAppSDK-App. And regarding to the mentioned docs Windows.Networking.Proximity.ProximityDevice is not unsupport so everyone assumes it's supported.

DarranRowe commented 7 months ago

Could you give us a more detailed explanation on those two reasons? It's not about UWP supporting WinAppSDK or not, It's about the Proximity Device as part of the WinRT-API that is working as part of a UWP-App but simply is not when used inside a WinAppSDK-App. And regarding to the mentioned docs Windows.Networking.Proximity.ProximityDevice is not unsupport so everyone assumes it's supported.

To put it bluntly:

Screenshot 2024-04-19 150231

CoreApplicationView, which is a UWP only runtime class has the exact same link for getting product support. As shown, CoreApplicationView is not supported in desktop applications. The Windows App SDK only supports being used in desktop applications.

This means that a UWP only class is being directed to a support forum that does not officially support that runtime class. This means that there is a mistake in the template, and they probably mistook it for the non existent Windows SDK tag.

But as I stated, you need someone from Microsoft to comment here.

codendone commented 7 months ago

I've contacted owners of the Proximity APIs to ask for help with this issue.

baaaaif commented 6 months ago

I've contacted owners of the Proximity APIs to ask for help with this issue.

wanted to ask briefly if they have already commented on the problem. Thank you

minze-it commented 5 months ago

Another month over... Some info would by greatly appreciated! Do the owners of the Proximity API have any idea or plan?

itmsau01 commented 4 months ago

I am encountering the same issue as described above. I would appreciate it if anyone could share any tips or solutions that might help in resolving this problem.