【发布时间】:2013-06-09 14:21:38
【问题描述】:
我正在编写一个 WP8 NFC 应用程序。
我从计算机向手机发送 (ndef) 消息。
在电话上我订阅了 NDEF 消息:_proximityDevice.SubscribeForMessage("NDEF", MessageReceivedHandler);
当我收到一条消息时,我的MessageReceiveHandler 会被调用,我可以处理该消息。
private async void MessageReceivedHandler(ProximityDevice sender, ProximityMessage message)
{
var rawMsg = message.Data.ToArray();
var ndefMsg = NdefMessage.FromByteArray(rawMsg);
var ndefRec = ndefMsg[0];
string recordType = Encoding.UTF8.GetString(ndefRec.Type, 0, ndefRec.Type.Length);
Debug.WriteLine(recordType);
}
这很好用。但同时WP8显示一个消息框:
+---------------------------------------------+
| Can't open |
| |
| Sorry, your phone can't recognise this type |
| of file. |
| |
| [close] |
+---------------------------------------------+
我是否必须在某个地方告诉 WP8 应用程序接受了该消息?或者为什么会出现该消息?
顺便说一句,我正在使用自定义 MIME 类型 application/ch.cimnine.myapp.v1。我是否必须以某种方式向 WP8 注册此 MIME-Type?
【问题讨论】:
-
很遗憾,Windows Phone 8 操作系统的这种行为无法更改,您无法控制手机的 NFC 提示
标签: windows-phone-8 nfc mime ndef