Home › Forums › Ask the Flomies › NDEFMessage always nil
Tagged: Swift
-
AuthorPosts
-
June 27, 2018 at 9:41 am #63302
Re order No.: 63008
We purchased the following:
– FloJack BZR NFC reader w/ SDK that Beeps and
– Flomio SDK Pro: Operate NFC Reader OfflineWe downloaded the SDK, followed the read me instructions and employed the FmSessionManagerDelegate methods.
Currently I am able to get into the didFind delegate method but the ndefMessage is always nil.
Can you advise on what may be the issue? Our tags are ntag213 which according to the forums are supported.
extension DashboardVC : FmSessionManagerDelegate {
func didFind(_ tag: FmTag!, fromDevice deviceUuid: String!) {
self.flomioSDK.readNdef(deviceUuid) { (ndefMessage) inprint(“ndefMessage :\(ndefMessage)”)
guard let ndefRecords = ndefMessage?.ndefRecords else { return }
for case let record as NdefRecord in ndefRecords {
print(“NDEF record payload: \(record.payloadString ?? “empty”)”)
}
}}
func didChangeStatus(_ deviceUid: String!, with configuration: FmConfiguration!, andBatteryLevel batteryLevel: NSNumber!, andCommunicationStatus communicationStatus: CommunicationStatus, withFirmwareRevision firmwareRev: String!, withHardwareRevision hardwareRev: String!) {
DispatchQueue.main.async {
guard let thisDeviceUid = deviceUid else { return }
self.deviceUid = thisDeviceUid;
print(“Device: \(thisDeviceUid)”)
}
}func didGetLicenseInfo(_ deviceUid: String!, withStatus isRegistered: Bool) {
DispatchQueue.main.async {
if let thisDeviceUid = deviceUid {
print(“Device: \(thisDeviceUid) Registered: \(isRegistered)”)
}
}
}func didChange(_ status: CardStatus, fromDevice device: String!) {
switch status {
case .present:
print(“tag tapped”)
case .notPresent:
print(“tag removed”)
default:
break
}
}func didReceiveReaderError(_ error: Error!) {
DispatchQueue.main.async {print(“Error: \(error)”)
}
}
}- This topic was modified 6 years, 5 months ago by Roseanne.
June 28, 2018 at 4:53 am #63307Hi Roseanne,
Although it is possible to read NDEF data with the FloJack, it is not recommended as reading data is slow. Previous customers have had success using the FloJack BZR when reading tag Uids. Our Bluetooth Low Energy devices support reading NDEF with much better speed and reliability. This is due to the slow data throughput of the audiojack interface.
Scott
- This reply was modified 6 years, 5 months ago by Scott.
June 29, 2018 at 4:49 am #63315Hi Scott,
We understand that the reading may be slow but we only have about 100 characters to read and we want to get this working for now.
We will consider moving to Bluetooth in the future, possibly.
Can you advise on how to get the NDEF messages reading as non nil?
Thanks,
RoseanneJune 29, 2018 at 5:16 am #63318There is an issue with the SDK which is causing your problem. I will fix this and release it in the next beta.
June 29, 2018 at 6:21 am #63320Hi Scott,
Do you have an estimate of how long we will be waiting for this?
Roseanne
June 29, 2018 at 1:19 pm #63326Hi Roseanne,
Sorry about the delay, we are a very small team with limited resources but I understand your frustration. It will be in the next month.
Scott
July 2, 2018 at 6:33 am #63339Hi Scott,
We understand there is a limited team but the documentation states that the pro SDK does support NFC read and write and this is why we spent the extra money to avail of these features.
Is there any way the next update can be pushed any sooner than a months time?
We need to have a solution production ready within 3 weeks.
Thanks,
RoseanneJuly 2, 2018 at 4:26 pm #63346As I’ve said before, I would recommend moving to use a FloBLE Plus if you want a reader which can reliably read NDEF tag data (even a 100 characters would be unacceptably slow on the BZR).
The BZR can in fact read and write NFC tag data and this bug will be address but unfortunately I cannot promise you quicker results without asking for Flomio Service Hours but I promise I’ll do my best to get it done quicker for you.Scott
July 3, 2018 at 3:18 am #63350We have an ACR1255U-J1 reader in house already, do we need to specifically buy the FloBLE Plus in order for the SDK to work?
July 3, 2018 at 7:20 am #63352Great.
It should work with your Pro SDK. This is a flaw with our licensing system so may not remain in the future but for now you should be OK. If you would like to use a Basic SDK with the reader, you would need to purchase a Basic SDK and register your reader serial number.
Scott
July 10, 2018 at 5:23 am #63394Hi Scott,
By chance, I saw the pro SDK was updated. I downloaded this and bought the fFloBLEPlus reader. I can now read NFC tags.
However, I’m not having any success writing NFC tags.The latest SDK does not have a read me but I think the method I need to use is writeRfidTag?
defaultConfiguration = FmConfiguration()
defaultConfiguration.deviceType = .kFloBlePlus
defaultConfiguration.transmitPower = .highPower
defaultConfiguration.scanSound = true
defaultConfiguration.scanPeriod = 1000
defaultConfiguration.powerOperation = .autoPollingControl
defaultConfiguration.allowMultiConnect = false
self.flomioSDK.delegate = selfself.flomioSDK.writeRfidTag(nfcStr.data(using: .utf8), withOffset: 0){
success in
if success != nil {
print(“success was : \(success!)”)
}
else{
print(“Unsuccessful”)
}
}I am never getting into the completion handler for this? If you could advise on what I’m doing wrong?
Thanks,
RoseanneJuly 10, 2018 at 5:39 am #63395Hi Roseanne,
Glad to hear you’re having a better experience with the FloBLE Plus.
The README is no longer the main source of truth, our SDK documentation has replaced that.
To write to your tags, the FmTag object has awriteNdef
method.If you want to write a URL to the tag, you can use the dedicated
createURIWithString
method like this:let ndefMessage = FmNdefMessage.createURI(with: "https://flomio.com") tag.writeNdef(ndefMessage) { (success) in if (success){ print("NDEF message written successfully") } }
Scott
-
AuthorPosts
You must be logged in to reply to this topic.