当 NFC 卡在范围内时收到通知

Get notified when an NFC card is in range

当任意 NFC 卡(任何带芯片的卡)在我的 Windows 手机 phone 范围内时,我如何收到通知?我有一台具有 NFC 功能的 Lumia 640。

不幸的是,我只找到了如何使用 ProximityDevice.SubscribeForMessage 订阅特定类型的卡,这需要 messageType。我想要一张通用卡 reader。我该怎么做?

Proximity API 仅支持 NDEF 格式的标签。因此无法检测到 "any card with chip"。最接近的是订阅任何包含有效 NDEF 消息的标签(这基本上归结为 "any tag supported by the device"):

subscribedMessageId = proximityDevice.SubscribeForMessage("NDEF", messageReceived);

其中 proximityDeviceProximityDevice 的实例,messageReceivedMessageReceivedHandler

请注意,还有 Smartcard API 可用于通过 NFC reader 枚举和访问某些非接触式智能卡。