NFCTagReader Session is invalidated unexpectedly

MattCalcuttMattCalcutt AUMember ✭✭

I've been trying to get NFC reading working on our iOS project but keep fighting the error "Session is invalidated unexpectedly". Whenever I call the BeginSession on the NFCNdefReaderSession object it just jumps straight into the DidInvalidate event with the NSError code of "Session is invalidated unexpectedly".

I went back and just used the example project provided by xamarin at "Xamarin.iOS - NFCTagReader" on I get the same error to occur on here.

I've mucked around with so many combinations of our provisioning profiles and still had no luck and from my post on stackoverflow xamarin-ios-nfc-session-is-invalidated-unexpectedly. Im not the only one encountering this error.

Can anyone tell me where im going wrong?


  • MattCalcuttMattCalcutt AUMember ✭✭

    Thanks for your reply Alessandro.

    Im still getting the exact same thing on that project for iOS after setting the correct provisioning properties I run it and click the button and it hits straight into the DidInvalidate event in the AppDelegate of iOS and has the error code: Session is invalidated unexpectedly.

    Does the iOS project run fine for you on that project?

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    Yes, it works fine. Are you working on a MAC or a Windows PC? Because VS2019 on Windows has a problem: it does not set the correct Entitlement file. Do you have the possibility to try on a MAC setting the correct Entitlement?

  • MattCalcuttMattCalcutt AUMember ✭✭

    Hmmm. Im running VS 2019 on windows. There's no way to work around it with VS 2019? I'll give that a go in the morning with just vs on the MAC. Would this be an issue with VS 2017 on windows?

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    I don't know about 2017. I have also opened an issue on Microsoft site but I am not able to find it… when I find it I sent you the link

  • MattCalcuttMattCalcutt AUMember ✭✭

    From what I gather from your bug request it only affects when you have automatic provisioning set, I run manual provisioning as is so would this still be an issue?

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    I don’t know. Are you able to set the entitlements file in iOS project’s properties?
Sign In or Register to comment.