
Originally Posted by
AhmedRBasuony
Hi,
I'm building an application using NFC for Windows Phone 8,
I want to know if the user enabled using Tap+Send from Device settings or not.
How can I detect that?
Hi Ahmed,
Did Influencer solution worked for you?
As the article he referenced, in order to detect if the NFC sensor is ready to be usd you can do a simple test:
Code:
var nfcDevice = Windows.Networking.Proximity.ProximityDevice.GetDefault();
if (nfcDevice != null) { // You are ready to use it
}
else { // The device is not enabled
}
For this to work you need to add the ID_CAP_PROXIMITY and ID_CAP_NETWORKING capability to your app. To do that, on Solution Explorer, select Properties and then double click the WMAppManifest.xml file. A properties windows should come up.
If your app requires a device with NFC to function properly, you can also select on the Manifest Properties the ID_REQ_NFC option. That will prevent users with devices that does not support NFC to install your app. I would not recommend it dough. I prefer to warn the user about the need for the NFC device but having him / her to install my app anyway.