Home › Forums › Ask the Flomies › Need working code example for NFC on ios7+
-
AuthorPosts
-
February 18, 2015 at 6:05 pm #44536
I have been engaging over email with support and they have asked me to post this in the forums.
What I need is a working code sample for how to use the NFC reader that we purchased on ios7+. Someone at flomio was nice enough to add us to a demo that I know works on ios7, but no code was provided.
I have tried every sample project in git hub, i have tried to put code together from those projects in my own project to no avail. All I need to do is a get the basics of reading the NFC so we can get this product going. Currently it feels like we are getting the run around and lots of excuses why no working code samples for NFC are available.
Any help in this matter would be greatly appreciated. It seems to me that working code samples for this product should be the very first priority, and you can worry about your full SDK with all the bells and whistles later.
February 18, 2015 at 8:38 pm #44555Hi Jacob, thanks for posting here. A typical NFC reader that you would find on the market works by way of a simple set of commands, often conforming to the ISO7816 specification. In order to make the reader perform an action, like reading a tag, you need to issue instructions (byte arrays) using the manufacturer provided driver, wait for the reader to perform these actions, and review the response (byte array). The responses have bit fields that indicate whether the instruction was completed successfully as well as other structured data relevant to the request. So for every action the hardware supports you need to have a function in your code that carries it through. Since some actions are asynchronous, this “action engine” can get quite complex.
The simple demo that we shared with you -and will soon be publishing on the App store- carries within it the Flomio SDK. We’ve taken the time to sort through the many complications involved with getting the FloJack (ACR35) to work like plug and play. Our SDK frees developers from having to implement:
- Optimized polling engine.
- Scan notification audio routing
- Plugged/unplugged device management
- Battery monitor and power tuning support
- Type 2 read/write data block (with authentication support)
- NDEF parser
- Cordova Plugin for cross platform support
With our solution, all a developer needs to do is drop in the SDK library and add this code to their ViewController.m:
- (void)viewDidLoad { // Instantiate the ReaderManager and find a reader to use. _readerManager = [[ReaderManager alloc] init]; _readerManager.delegate = self; } - (void)Reader:(Reader *)reader didFindATag:(Tag *)tag { // Review tag data }
We think this will make developing applications much easier and we want to continue to evolve the SDK to support our BLE and UHF RFID hardware. In order to do so we need to properly monetize our work. The FloJack is our branded version of the ACR35 manufactured by Advanced Card Systems. If we open source our SDK then there’s nothing that prevents customers from buying units directly from ACS or their many distributors. That is the reason we are working to properly protect our assets so that we can stick around to build more value. This is not a simple task and it’s upsetting that we’re spending just as much time figuring out how to secure our SDK than getting it to work. But that’s what we work on every day. All 4 of us.
Once ready, the SDK will only work with FloJacks and not stock ACR35s. This is because our cryptographic keys are stored into every FloJack before shipment. These are validated by the SDK and enable it’s function. That said, we don’t believe in stifling developer progress so we also sell stock ACR35s on our site and answer simple questions regarding it’s operation. If you want us to build an SDK specific to your needs (with source), we’ll be more than happy to do that. Our consulting rate is $150/hr and we can prepare a detailed quote based on your requirements. Just send your request to info@flomio.com along with the details of the functionality you need.
cheers,
RichardFebruary 18, 2015 at 8:55 pm #44560I completely understand what you are saying, but the problem is that we bought a reader and there is no documentation or working code sample to get the NFC working. Even looking at the ACR35 it only shows an example of the card reader, not the NFC.
I looked at the documentation link and didn’t see any instructions on how to communicate with the NFC reader. I have looked at all of the examples in github and nothing is talking to NFC.
It seems incredibly odd to me that you are selling this piece of hardware without providing a useful way to actually start working with it. Now you’d like to charge 150 per hour to build out what should already be included in the github download page? The link you sent doesn’t even have anything related to NFC in it.
I am looking forward to the SDK, but from the forums it looks like that has been in progress for months and months. So what doesn’t make sense to me is that every person who buys this reader has to recreate the wheel and figure out all of the communication layer, when at the very least we should be granted a library to do simple things.
It seems to me that if you have and SDK working that connects to a reader and reads from NFC, you can pull those methods out of the whole SDK, but together a simple controller with a handful of methods or package a .a library or .framework or something that can be imported into the project.
If I am completely wrong in this, can you please point me to the github example in your code that reads NFC on ios7?
February 18, 2015 at 9:26 pm #44565You’re not looking at the documentation well enough. I wrote most of the our SDK myself and I started with the exact same documentation. ACS is notorious for not being forthcoming with information on how to use their readers. Just Google for ACR122u and you’ll find pages and pages of folks hacking to build applications by trial and error. We went through this process in the past and have done so again with the ACR35. That’s the value we feel we bring to the table and are putting it all into the SDK.
The FloJack Demo application is very much capable of reading NFC tags. You just need to know how to follow the ISO7816 protocol to achieve it. If you haven’t worked with this protocol before, it’ll take some time to ramp up but it’s definitely achievable. It might help to order an ACR122u so you can get familiar with the protocol while browsing through all the open source code available online. There’s a bunch, some of which we authored. Another option is go with a “keyboard wedge” type NFC reader. These are more expensive but they come with the Bluetooth HID profile built in, allowing your app to pickup NFC tag UUIDs without much work at all.
February 18, 2015 at 9:51 pm #44568Richard, I appreciate your quick responses here.
I have opened up that project a number of times. I have viewed it on the device and looked at the code.
the phrase “NFC” doesn’t exist anywhere in that project. when i compile that app, all it does is read card swipe data. Nothing is triggered when i put the reader on an NFC sticker, nothing in the code looks like it’s listening for NFC.
So what I am asking for, if it’s so achievable and tons of people have done it, is why don’t you provide a working Xcode project where i can see NFC being read?
So you know, I have written iOS software before that uses card swipe data from multiple different card reader brands using various payment gateways with at least 4 different audio jack readers. What I am struggling with here is trying to use the sample code provided to read NFC and I can’t see anything on how to do that.
in the documentation provided here: https://www.dropbox.com/sh/90sj03mzqfac7d0/AACA-im8ZhRkwFbKW2ZoHYEDa/REF-ACR3x-1.01.pdf?dl=0 It only says that NFC is supported, not actually how to communicate with it.
If you look at the read me file for the project you are linking to it only mentions card swiping. If you compare the ACR35 folder to the FloJack folder on github, they are pretty much the same exact thing and no mention of NFC. If you look at the NFC folder in github it has a project that compiles a library, but no documentation on how to use the library, if that is even the one that is supposed to be used.
I just don’t understand why we should be re-inventing the wheel here when it seems pretty obvious on the website that if you buy the reader you will get a working SDK with it.
you have linked twice now to a project that I am claiming simply doesn’t work with NFC. Can you please personally check that link you are sending me to and explain how one would use NFC with that demo considering everything about the UI and the code seems strictly to get the card swiping to work, which seems to work just fine.
i would love to be proven wrong here. =)
February 18, 2015 at 10:01 pm #44571the real kicker here is that the publicly available apps you have don’t even seem to work. The NFC Actions app that you have in the app store doesn’t work. I tried on ios6 and ios7.
The demo apps for inspecting stuff always shows errors about flash memory being corrupted or something like that.
The only thing I have actually seen work is the demo app that you sent over, which is why it would be great to an Xcode project that connects to a reader and listens for NFC.
February 18, 2015 at 10:13 pm #44574I’m at the end of my rope in terms of what I can do for you. You need to educate yourself on the technology you’re looking to leverage. Look up the terms presented in the demo app in the NFC Glossary and you may get somewhere. As I see it, you’re looking for free consulting at this point. I’ve told you everything that we used to get our app working and sent you the built sample app as proof. If you want more, you’re going to have to pay for it. We’ve got bills just like everyone else.
February 19, 2015 at 12:05 pm #44678I guess, I was just expecting that the SDK provided would be useful.
I also thought that if it wasn’t you would be willing to copy and paste some code or point to a specific part of the project to look at instead of sending me lmgtfy.com links.
At the end of the day i was able to see some stuff in the PICC example on github, but I still don’t see a valid way to read a tag. I looked up the terms you suggested and dug around the code, but I still have yet to see how to read the NFC tag.
Could you point me to where in that project that happens? I did a reset and when i do a power on i seem to get back an ATR, but it’s the same ATR for every every sticker on the sheet. The second sheet of stickers had a different ATR, but again it’s the same for every sticker on that sheet.
I don’t know how fair it is to your customers to link developers to an SDK that is not super clear to get up and running with, and then just say google around and find people building stuff via trial and error.
It’s not hard to find lots of unhappy customers in this forum, I think a little more support would go a long way to make us very happy cusomters. I’m not asking you to give away all the secrets of your SDK or open source something you might otherwise be able to monetize, but as a customer who plans to buy a bunch of your products as soon as we are confident in the product, I would imagine you’d want to help us achieve our fairly simple goal.
Our team is ready to move on and use our plan B, but I feel confident this is our best solution and so I’m trying to make this work. I’d love if you or one of the other devs could give some clear direction on how to read the NFC stickers we bought from flomio using the NFC reader we bought from flomio, using the code provided by flomio. Thanks so much.
February 19, 2015 at 1:05 pm #44687Hey Jacob, I’m glad you keep poking around. You’ll find you’ll get a lot more support from us as you make the effort. In the end we’re developers just like you. ATR stands for “Answer to Reset” and it’s the tags’ way of saying “hey, this is what I am”. We sent you two NFC sticker sheets (even though you only ordered one) so you could have some diversity to play with. Each sheet has a different set of tag types. That’s why the ATR is the same for each tag on each sheet. The next step is to extract the tag type and manufacturer and then check the spec sheet for the manufacturer to find the command that reads it’s data blocks. Data block 0 will contain the serial number of the tag, aka the UUID.
It’ll take a bit of work but you’ll get there. If you end up going with plan B, no big deal. In the end, we’re here to evangelize proximity ID technologies and love developers that want to get involved. We actively teach an NFC Bootcamp and there’s one coming up in March in case you’d like to attend. Many people drawn to the sexiness of NFC, BLE, and UHF RFID are irritated to find out that the technology is raw, support is unpolished, and documentation is scarce. Our mission is to change that and although we’ve had our share of unhappy customers, we continue to get better every day. We hash out issues openly and have made our case with each and every customer that asks.
What is your intended use case for NFC and the FloJack? You explained before that you’ve integrated other audio jack devices into iOS apps and that things were much easier. How so? What was provided and in what fashion did it make for easier integration? You’ve spent $90 with us so far, how much did you spend with the other devices before having a working solution?
thanks for the feedback!
February 19, 2015 at 2:25 pm #44698i found a different PDF i didn’t see before and it talks about sending commands to the reader. I followed the instructions in the pdf
I am using the mifare 1k nfc tags if i am not mistaken. the sticker sheet wit the green storm troopers.
I am trying to send the command FF CA 00 00 00
the response APDU seems to be the same for every tag on the sheet.
I also tried manually calling sendCommand like this:
const char byteArr[] = {0xFF, 0xCA, 0x00, 0x00, 0x00};
[_reader sendCommand:byteArr length:5];and I received the same response for every tag.
Any thoughts on that?
February 19, 2015 at 2:32 pm #44701w00t!! great progress. I’m sure you’re starting to realize that in fact all the info you need is right where I said it was. I definitely can help you to the next step. But before we get to that, can you answer my questions from my previous post first? It’ll help me guide the conversation better.
February 19, 2015 at 2:33 pm #44702regarding my work with other card readers?
February 19, 2015 at 2:34 pm #44703Yeah.. all these questions:
What is your intended use case for NFC and the FloJack? You explained before that you’ve integrated other audio jack devices into iOS apps and that things were much easier. How so? What was provided and in what fashion did it make for easier integration? You’ve spent $90 with us so far, how much did you spend with the other devices before having a working solution?
February 19, 2015 at 2:54 pm #44706we are really just trying to read nfc from a wrist band for registration and we use that throughout some events that we do. We already do this with RFID with great success and are thinking NFC is a great next step
For past work, the libraries I used had working Xcode projects. I was able to read through documentation and run the sample project and see how all the data was sent and received. I didn’t need to pay for the readers, they were provided to us. What I built was an SDK that worked for a payment gateway to integrate with multiple types of readers through one library.
We spent 90 dollars to get a proof of concept together, but we would be spending a significant more money on the devices we need for events if we can get this working.
February 19, 2015 at 4:15 pm #44717Hmm, that’s really interesting. Just a few more questions if you don’t mind:
- RE: RFID experience. Were these LF (125kHz), HF (13.56MHz), or UHF (800MHz) RFID wristbands? How was the technology used? Guest walks in, is assigned a wristband, and taps it at booths around the event?
- Why do you think NFC is a great next step from the RFID solution you have in place? What benefits does NFC offer you?
- RE: Free readers. How/why did you get the readers for free? What volumes of readers did you end up purchasing from these vendors after your development was completed? Did you end up purchasing from all vendors or only ones that best fit your needs?
- RE: SDK. How many readers did it support? What mobile platforms in particular was is compatible with? Did you distribute the SDK to your customers or just used it internally?
- RE: Payment gateway. What gateway did you integrate with? We you performing cloud-based (CNP) payments or processing credit cards in person (CP)? Did you experience server latency and if so, how did you compensate for that?
thanks for the feedback!!
February 19, 2015 at 4:24 pm #44720if we can get this working, it’s just less hardware for us to maintain currently.
all of your other questions seem pretty unrelated to getting a tag read with your reader.
February 19, 2015 at 4:50 pm #44726If you’re looking to place a volume order with us then this information is key for us to offer you the best solution and support. Our value proposition is predicated on understanding our customers and their use cases really well. If this is too much to ask, then perhaps you’re better off going straight to the manufacturer or another one of their distributors.
February 19, 2015 at 5:16 pm #44730Seems to me that all you need to know is that I want to be able to read NFC tags from a wrist band using ACR35 reader for ios.
I have told you the last part I am stuck on, you said you could help me get to the next step. The work i did with other card readers is not relevant to this discussion other than to let you know I have had experience working with byte data from an audio jack.
I’d love to move forward on getting this NFC tag read using the ACR35 sample project in github. Can you help me understand why the APDU response is always the same and what I can do to send the command to read the tag properly? thanks so much.
February 19, 2015 at 5:41 pm #44735Sorry buddy, without further information I can’t help you any more.
February 19, 2015 at 7:07 pm #44746just to be clear, unless I give you information about my other projects and my relationship with other vendors you will refuse to help me get past this next step with the products your company manufactures and the code you provide for those products?
February 19, 2015 at 8:35 pm #44757Not at all. Our company doesn’t manufacture the product which you purchased, we simply distribute it. Our position is that unless we learn how our customers use the products we sell in the context of other products they’ve used in the past, then we will never be able to exceed their expectations in terms of service and support.
February 19, 2015 at 8:40 pm #44760how i use RFID and what software I’ve written using other credit card readers is completely unrelated to the fact that I can’t read an NFC tag.
you said you could help me get past this next hurdle, but now you refuse unless i answer questions that are completely unrelated to what we are trying to do with NFC.
February 19, 2015 at 8:45 pm #44761It’s ok, we can agree to disagree. I’ll ping this thread as soon as our SDK is available and I can be more help to you. Sorry for the inconvenience.
February 20, 2015 at 12:39 am #44791I have never seen someone try so hard to push a customer away.
February 20, 2015 at 12:53 am #44794We look forward to winning your business in a way that’s sustainable for us. As I explained before, your current conditions don’t allow for it.
February 24, 2015 at 9:59 am #45621Hi Richard,
I have purchased a flojack device from you and we are working on a ipad app where would like to implement the methods like didFindATag or the class ReaderManager.
is there a specific SDK which i need to download so that we can get these classes?
i have already review the following sdk codes
https://github.com/flomio/flomio_ios/tree/master/FloJack
Please help
Amrit
October 2, 2015 at 7:39 am #53499Hi Amrit, the latest Flomio SDK to work with the FloJack can be downloaded from here. Inside the bundle you’ll find a README.md file with all the details of how to build a sample app using the library. We have a more comprehensive Sample App that we can send you via TestFlight if you want something quick to test your FloJack with. Just let me know your Apple ID email so I can send you an App invitation.
thanks,
Richard -
AuthorPosts
You must be logged in to reply to this topic.