when i use shortcuts -> automatization-> creat automatization -> NFC. My iphone can see my tag. But when I create my own project with coreNFC to detect nfc tag, my iphone cant see my tag, but it see other tag. Tag mifare
import UIKit
import CoreNFC
class ViewController: UIViewController, NFCTagReaderSessionDelegate {
@IBOutlet weak var UIDLabel: UILabel!
var session: NFCTagReaderSession?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
@IBAction func CaptureBtn(_ sender: Any) {
self.session = NFCTagReaderSession(pollingOption: .iso14443, delegate: self)
self.session?.alertMessage = "Hold Your Phone Near the NFC Tag"
self.session?.begin()
}
func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) {
print("Session Begun!")
}
func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) {
print("Error with Launching Session")
}
func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) {
for nfcTag in tags {
print(nfcTag)
}
}
}