Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QRCode encoding a simple string in ios

I have downloaded a sample code from github for QRCode encoding.

It works fine and generates an image with QRCode for string that I specified.

But, when I scan that image, it displays the string like http://mystring.

I need only mystring. How to do that? Is the problem is with QRscanner app?

I think the QRencoderapp is about encoding an url.

Is there any other sample to encode just a simple string (not url)?

or

Is there any changes to be done get the string instead of url in the above code?

like image 617
Nazik Avatar asked Sep 15 '26 11:09

Nazik


1 Answers

I 've solved my problem.

I downloaded a project from this Github link.

The code in that prjct creates a QRCode image for a simple text.

NSString *code = @"Our String to be encoded";

Barcode *barcode = [[Barcode alloc] init];

self.view.backgroundColor = [UIColor whiteColor];

[barcode setupQRCode:code];

ourImageView.image = barcode.qRBarcode;

Hope, this will help others.

like image 74
Nazik Avatar answered Sep 18 '26 03:09

Nazik