I have to agree. After all, this is not free software. It’s a yearly subscription. Having a subscription business model and not maintain/support the software in this way is unfortunate.
In the mean time you can check and re-ask for permissions to the camera yourself creating a utility function ala this:
u.ensureCameraPermission = function(qrFunction) -- Check for camera permission grantedList = system.getInfo("grantedAppPermissions") for k,v in pairs( grantedList ) do if ( v == "Camera" ) then return true end end -- Permission denied. Ask for camera permission local options = { appPermission = "Camera", urgency = "Critical", listener = qrFunction, rationaleTitle = "I need camera access!", rationaleDescription = "The app needs camera access to be able to scan for QR codes. Please give the app access to the camera!", settingsRedirectTitle = "Alert", settingsRedirectDescription = "The app needs camera access to be able to scan for QR codes. Please give the app access to the camera!" } native.showPopup( "requestAppPermission", options ) return false end
Which can be used before the call to the sqscanner ala this:
local function qrMsgListener(e) print("qrMsgListener()") print("Calling: 'qrscanner.show(qrListener)'") waitingForQRScanner = true qrscanner.show(qrListener, { symbols = { 'qr' }, strings = { title = s.str("Scan the QR code!")} }) print("Called: 'qrscanner.show(qrListener)'") end local function qrButtonHandler() if (u.ensureCameraPermission(qrMsgListener) == true) then qrMsgListener() end end
Please, check my code and tell me how to show scanner again after the success reading? Now I’m getting black screen after reading on Android.
local qrscanner = require('plugin.qrscanner') local toast = require('plugin.toast') local function onResult( event ) if ( event.isError ) then toast.show("Network error: ", event.response) else toast.show(event.response) end end local function listener(message) local path = "http://domain.com/check.php?id="..message network.request(path, "GET", onResult) end qrscanner.show(listener)
I don’t get qrscanner to work with my Nexus 4 test phone running Android 5.1.1. Nothing happens when qrscanner.show() is called. The app has the needed permissions to the camera.
@Lerg - big fan of the QR code scanner. Got an idea where the iPad is wall mounted. is it possible to use the front camera for scans? Could we specify the camera in the options? If you could do that it would be awesome!!!
alfred361, about black screen - please make a small test project and send it over. Plus provide full details - platform, device, os version, a video recording could be helpful as well.
Showing result over video - no, no possible.
Windows Phone has no support for Corona plugins.
And it’s too difficult to make windows or mac plugin.
@Lerg - thanks. May have a work around - will test later…
if ( system.getInfo( “environment” ) ~= “simulator” ) then
display.setDefault( “cameraSource”, “front” ) – Front-facing camera
–display.setDefault( “cameraSource”, “back” ) – Back-facing camera
end
[quote name=“matt405” post=“354803” timestamp=“1491616141”]@Lerg - thanks. May have a work around - will test later… if ( system.getInfo( “environment” ) ~= “simulator” ) then display.setDefault( “cameraSource”, “front” ) – Front-facing camera --display.setDefault( “cameraSource”, “back” ) – Back-facing camera end[/quote] I doubt this will work, this is designed for source fill object from camera
Oh… - any work around you can think of @Lerg? Really like the idea of expanding our “time management” features with your QR Code scanner, but would only really work through a wall mounted Ipad…
You can open the ipad, drill a hole in the front and rotate the back camera to face front.
Or you can install a periscopic mirror that would direct the light from the front side to the camera module.
You can also open and ipad and rotate the screen, like unfold the tablet. That way both sides become front.
Change topbar background color.
Apply a mask to the camera, only the area inside the mask will be processed.
Change mask color.
Use regex to filter results.
Use front camera.
Listener receives a normal event table.
Errors are submitted to the listener within the event.
Topbar now can fit long text.
Orientation code has been changed on Android, tell me if it got better.
What’s broken.
Listener now must be provided inside the params table, not as the first argument of the qrcanner.show() function.
Listener now receives an event instead of the message. Message is inside event.message.
New version is tied to the Corona public release - 2017.3068. Use it or a later one.
I expect new bugs to appear. Especially about orientation and masking.