The QR Code API is an HTTP API that can be use for creating custom QR Codes programmatically.
The app.qrCode.onReceived
is for When you use QR technology in your project, you can handle the data received from QR in this event and call on any page to be displayed to user with app.qrCode.start
event.
Type:
Function
app.qrCode.onReceived = function (data) {};
The app.qrCode.onReceived
has one parameter that named data.
Parameters | Type | Description |
---|---|---|
data | Object | Contain the QR information. |
// on QR Code data received
app.qrCode.onReceived = function (data) {
if (data)
homePage.show();
};
The app.qrCode.start
is for When you use QR technology in your project, you can handle the data received from QR in this event and call on any page to be displayed to user with app.qrCode.start
event.
Type:
Function
app.qrCode.start();
The app.qrCode.start
is used for when we want to use the QR Code inside the app.
app.security.ensurePermissions({android: {0: 'android.permission.CAMERA'}}, function (granted) {
if (granted)
app.qrCode.start();
else
app.controls.box('alert', null, 'Grant access to a camera to scan the barcode.', 'left');