I need to generate a QR in a iOS App.
I found some third parties plugins that generates QRs codes but any of those are for iOS XoJo platform.
MBS, Einhugur and J4L are for the other Xojo platforms but not for iOS.
Anyone knows one that works with iOS ?
If not, anoyone know some API that could be used to generate a QR online so my App could sent the content of the QR and the API returns the QR ?
Sorry, no plugins for iOS.
But I think there is a core image filter for creating QRCodes which may be available via declares.
Here’s a Web API that you might want to experiment with:
Thanks Tim I will try it as an alternative method.
I preffer not to depend on an external service, but the alternitive will be good for my prototype.
Thanks Christian for your answer.
I will try your tip to use core image filters via declares.
Probably it could be a good solution.
I found some web pages with code writen in XCode that uses this method to generate QRs
@Mariano Poli: I was thinking about your need for a way to generate QR codes without depending on an external service, and it reminded me of one of the open source projects that I worked on back in 2014.
It turns out that it is not only possible, but that’s also pretty easy to do. I was able to repurpose a good portion of my original code for use within a Xojo iOS project. I created a Xojo class called “EasyBarcode” which generates a data URL, which in turn renders either a barcode or QR code when it is loaded into an iOSHTMLViewer control. The class can be used to generate QR Codes and barcodes in a wide variety of symbologies (including using the EAN 8, EAN 13, UPC, Standard 2 of 5, Interleaved 2 of 5, Code 11, Code 39, Code 93, Code 128, Codabar, MSI, and Data Matrix).
If you’re interested, here’s a link to a very basic Xojo project file that includes the class: Xojo-EasyBarcodes.zip
If you get a chance to check it out, please let me know what you think. I hope it proves to be useful!
There is, Core Image has a couple of barcode/QR code generators. All built into the OS, you simply need to learn how to take advantage of it via declares. There’s also API for reading the codes too.
Looking at some source code seems that this could be done right in Xojo and be fully x-platform
Check out my iOSKit - I have a module for generating QR Codes already written.
Thanks @Tim Dietrich
Works fine !!! Very kind from you to share this whit me.
The only thing it is pending for me now to finish my project is to know a way to identify the device which generates the QR. That means a way to get the IMEI, MAC or phone number, to include it in the information of the QR
Thanks @Jason King
I had visited your iOSKit on GitHub, but I dont know where to find the Declares in order to use barcode/QRcode functions to generate them.
Could you please tell me where to look for them.
For me you are “Declares KING”, so I also want to ask you if you know any function that let me get some ID of the device, like de phone number asociated to it, the IMEI, MAC or any other available ?
You cant get any of those things without asking the user
As has already been stated several times on the other thread https://forum.xojo.com/33674-how-to-get-imei-and-phone-number
You cant get any information from the phone that could be used to identify the person that owns the phone (phone #, imei, etc)
At least not without asking the user
And if you try to post your app in the app store Apple will reject it
You should use [UIDevice identifierForVendor]
Have you tried it ?
The alternate is the advertisingIdentifier
It has some requirements about how its set up etc but its another way of identifying a device
A llittle bit more of my needs and the reasons of them.
I want to use QRs with encripted information to let access / do not let access.
If for any reason the QR was cracked, when the QR was read, if the QR includes an ID of the device, it will be possible to know which device was used to access in order to identify the person who use that device to have the access.
That was the reason why I need an information related with the phone or the phone line that could not be alterated.
I understand that Apple limited the access of this information and I also could understand why
The fact is that this limitation do not let my solution to have this security feature.
sounds to me more like you should be distributing signed items and installing them in a persons passbook
like an airline boarding pass (which is also a qr code)
that way they can be individually signed and you know who got what code
and if one is breached you can revoke that one
Airline boarding pass is a nice example.
What the Airline does is to send you a QR with some information (ex. your boarding pass info).
To access to the plane, the QR when is read, is validated against a database, and the system could determine if the QR that you receive in your phone is valid or not.
The QR could be duplicated or the message of the airline sending you the QR could be intercepted.
Imagine that you dont receive a QR and instead the App receive the information to be included in the QR, and the QR is generated by the App by itself.
At that moment not also the information of the boarding pass will be included in the QR but also some ID of the phone.
As the Airline doesn´t know any information of your device that information couldn´t be included in the QR prevously when they send the QR to your phone, but if they send the information and the App generates the QR, some information to idenfiticate the device could be included in the QR.
So the information in the QR will be valid and you have access, BUT the information of the device used to access will be in database record of you access.
You cant get access to “personal information” (phone #, IMEI, etc) without asking a person to enter it
Or you;d have to force them to jailbreak the device to use your app - something I doubt people will want to do
If they do enter “something” you have no idea if it is “correct”
And you cant check that it is right since you cant read it - the original question you asked
Now you have no idea if many people all enter the same thing (ie/ you have 10 people enter 111-111-1111)
So you’re worse off if you have to ask
Read the docs about UIDevice identifierForVendor
It literally says
An alphanumeric string that uniquely identifies a device to the apps vendor. (read-only)
which sounds exactly like what you want
It wont be the same between any two devices
What you cannot do is say “oh thats is Joe’s phone” (again this may violate privacy laws in some countries to be able to do so)
But from the sounds of it you dont need to do that - you just need to disable that one “code” so its no longer considered valid
Thats still doable even if you dont know whose device it is
Joe will phone you or send an email saying “hey my device no longer works”
I dont know enough about apples passbooks to know if you can send it to and lock it to one device