QR Reader and GPS in the app

lb113314 8 years ago updated by icahill (Administrator) 8 years ago 9
Does anyone have the code to build a QR reader and GPS inside the app?
Sorry for the late reply.

The fastest and easiest way to implement QR scanning is to use the following attributes in connection with the camera example.

<camera alias="CAMERA" name="panel" type="barcodescan" onscan="alertaction"
background="#FFFFFF" height="100%" width="100%" align="center" valign="top"></camera>

Camera example: https://studio.rarewire.com/wordpress...
Great stuff - I can capture the QR code and display it in an alert, as in the code example. However, I'm unable to use the captured url to load a web page. Fusebox simply quits. Is this a bug?
Are you capturing the scanvalue and converting it to a variable before you attempt to use it?

<assign property="var:code" value="[object:nameofcameraalias.scanvalue]" />
<assign property="object:nameofwebalias.url" value="[var:code]" />
I did assign the scanvalue to a variable, and had then referenced it in tag. I tried also setting the object property using another assign tag, as in your example code, but neither approach works for me. The Alert tag shows correct scanvalue contents, and hardcoding a url works fine, but trying to get the scanned url to load causes Fusebox to quit. There must be something else I need to do (newbie inexperience), or there is a bug.
I had referenced [var:code] in a load tag, but I also tried assigning the URL property.
I am not aware of any bugs associated to this. I would love to take a look at your code to see if I can find the issue. you can invite me as a collaborator if you would like (icahill@rarewire.com).
It is best practice to always put your assign tags at the top of an action, esp. when using a sync. They have the tendency to get overridden otherwise. What was happening to you is that when your replace tag kicked in the assigns were not completing and losing the value from the camera. So to fix this I just made the assigns happen first in your action.
Ian thanks for your help. Has anyone used QR scanning with GPS like google maps? So if I wanted to Scan a QR and then link to GPS in the same app?
Are you saying the QR Code contains a link to a map coordinate?