iOS Question Reading UID from NFC Card

Nicolás Cieri

Active Member
Licensed User
Hi, is posible to read the UID from the iPhone?

Something like that...

I saw in the documentation of the library that it is not possible, but that is 5 years old, will it be possible now or not yet?

Thanks.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've tested this code with ndef tag:
B4X:
Public Sub Scan (DialogMessage As String)
    NFC.Scan(DialogMessage)
    Wait For NFC_TagConnected (Success As Boolean, Tag As Object)
    If Success Then
        Try
            Dim InternalTag As NativeObject = Tag.As(NativeObject).GetField("_tag")
            Log(InternalTag)
            Dim uid As NativeObject = InternalTag.GetField("_uid")
            Dim b() As Byte = uid.NSDataToArray(uid)
            Dim bc As ByteConverter
            Log("uid: " & bc.HexFromBytes(b))
        Catch
            Log("failed to read uid")
            Log(LastException)
        End Try

Based on: https://www.b4x.com/android/forum/threads/nfcex-class-write-ndef-tags.110726/#content
 
Upvote 0

Nicolás Cieri

Active Member
Licensed User
If I scan with this method:

[IMG alt="Alexoconnor"]https://discussions.apple.com/public/assets/avatars/SYSTEM_DEFAULT_AVATAR.svg[/IMG]
Alexoconnor
User level:Level 1

13 points
Nov 1, 2021 12:10 PM in response to lobsterghost1
  1. On your iPhone, open the Shortcuts app.
  2. Tap on the Automation tab at the bottom of your screen.
  3. Tap on Create Personal Automation.
  4. Scroll down and select NFC.
  5. Tap on Scan.
  6. Put your iPhone near the NFC tag.
  7. Enter a name for your tag.
  8. Tap on Add Action.
from https://discussions.apple.com/thread/253186716

I can scan, but not with my app. and not also with other apps like "NFC"
 
Upvote 0

Nicolás Cieri

Active Member
Licensed User
Hello, I am trying to get the UID but it gives me very different things.

Any idea? Thanks a lot.

uid: 0816BD0BF10E5C67

1673913159440.png

1673913100409.png
 
Upvote 0
Top