2013-06-13 49 views
3

我正在寫一個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類型?

+1

不幸的是,Windows Phone 8操作系統的這種行爲無法更改,您無法控制手機的NFC提示 –

回答