c# - SmartCardReader won't fire CardAdded method? -


i trying microsoft phone fire , event, when nfc tag tapped. method wont fire when tag tapped. cardreader_cardadded should fire when tag tapped, nothing. here code:

public mainpage()     {         this.initializecomponent();          smartcard();     }      public async void smartcard()     {          string selector = smartcardreader.getdeviceselector();         deviceinformationcollection devices = await deviceinformation.findallasync(selector);         foreach (deviceinformation device in devices)         {             smartcardreader reader = await smartcardreader.fromidasync(device.id);             reader.cardadded += cardreader_cardadded;             reader.cardremoved += cardreader_cardremoved;         }     }     private void cardreader_cardremoved(smartcardreader sender, cardremovedeventargs args)     {      }     private async void cardreader_cardadded(smartcardreader sender, cardaddedeventargs args)     {         await handlecard(args.smartcard);     }      private async task handlecard(smartcard card)     {         smartcardprovisioning provisioning = await smartcardprovisioning.fromsmartcardasync(card);          smartcardstatus status;                 {             status = await provisioning.smartcard.getstatusasync();         } while (status == smartcardstatus.shared);      } 

answer: forgot enable proximity under capabilities in package.appxmanifest


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -