Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective-C : is it possible to detect QR code data type?

I did qr code with Zxing, Right now I can read data but what I want is :

  • Example: Be able read type of QR Code is wifi, VCard, Calendar, url, etc... if detect QR Code is wifi so I be able code to change wifi setting key,

So, how do i know that data read from QR code is wifi?

like image 953
sarak Avatar asked Sep 01 '25 20:09

sarak


2 Answers

QR Code itself does not specify any types. Its plain text. It can be an HTTP URL or a custom URL. (e.g. it should have "type://wifi" inside it. You can then use it to see what the type is). But off-the-shelf, there is no such thing. You have to know who is creating the QR Codes and what is he storing in them.

like image 125
zakishaheen Avatar answered Sep 03 '25 17:09

zakishaheen


There is no standard format for encoding wi-fi information in a QR code. There is a de facto standard suggested by zxing and supported by Barcode Scanner, which is like:

WIFI:T:WPA;S:mynetwork;P:mypass;;

(This imitates many of DoCoMo's standards for QR code contents.) I'd just reuse this if you can.

This page lists common encodings for other data. Whether you can do anything with them on the iPhone, I don't know. On Android you can scan these to configure Wi-fi and add contacts.

like image 42
Sean Owen Avatar answered Sep 03 '25 19:09

Sean Owen