Hello I’m using Expo SDK 44
How can I parse the scanned result data received from my barcode scanner to a new screen?
Data scanned ex => MATMSG:TO:email@example.com;SUB:subject;BODY:description;;
How to show to user a normal data?
Are you expecting to only scan these “MATMSG” QR codes? Or is this just an example?
Either way, the QR code just represents a blob of data. That data might look like a URL or it might look like vCard data etc. If you know that the data should be one of these MATMSG things then you should be able to parse it manually or else maybe you can find an existing npm that parses them.
If you could get any random type of data then your code would probably need to check if it looks like a URL. If so, treat it as such. Otherwise see if it looks like vCard data, you can use a vCard parser to parse it. Otherwise if it looks like iCalendar data you could use an iCalendar parser. etc.
EDIT: See also:
The MATMSG” QR codes are just an example of the problem there are a lot of types of QR Codes (email, vCard, URL, WIFI, Event…) I just ask if there’s a simple way or a solution already built to use it instead of checking the content manually
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.