Plugin.NFC icon indicating copy to clipboard operation
Plugin.NFC copied to clipboard

Get ITagInfo of Launch Tag

Open marcellangmaier opened this issue 4 years ago • 4 comments

Thank you for the great plugin. Easy to use and works very well. I made an app which is launched on scanning a tag. The app gets startet as it should be. But how can I get the Tag Information (I am interrested in the Serialnumber) for this Launch Tag?

I am using this Plugin in my Visual Studio 2019 solution with version 0.1.19 of your plugin.

marcellangmaier avatar Jan 26 '21 11:01 marcellangmaier

  • You have to first assign an event handler function to the event, like this: ‘CrossNFC.Current.OnTagDiscovered += Current_OnTagDiscovered;’
  • Then start listening to the NFC
  • Once you tap on an NFC device it will call that event handler function and carry the ITagInfo object with it along with all the data you need

@marcellangmaier

saamerm avatar Jan 26 '21 14:01 saamerm

Thank you for your reply. You are describing the procedure to read an NFC tag inside an app. Thats not my problem. My problem is the following: Once my app was launched by touching an NFC tag, I want to be able to know the SerialNumber of the tag which caused the app to start.

marcellangmaier avatar Feb 04 '21 15:02 marcellangmaier

Ah I see! @marcellangmaier, according to https://stackoverflow.com/a/60205855, you need to add some code in your override of the OnNewIntent in your main activity and you'll be able to get the info of the object that woke up your app

saamerm avatar Feb 04 '21 17:02 saamerm

@marcellangmaier, any success, do you want to close this?

saamerm avatar Apr 13 '21 08:04 saamerm