Barcode reading once and continuous reading

This RayBarcode sample makes it easy to try barcode reading with your smartphone’s “RayKit” app.

The following operations are possible with this sample.

  • Barcode read once
  • Continuous reading of barcode

Note that continuous read consumes one API request for each read operation.

Sample configuration

This sample uses the following files:

Visualforce Page

  • GcBarcodeScannerDemoPage
  • ScanBarcodeComponentControllerTest

Apex Class

  • GcBarcodeScannerContinuousScanService
  • GcBarcodeScannerDemoPageController
  • GcBarcodeScannerDemoPageControllerTest
  • GcScannerContinuousScanServiceTest

Samples can be deleted. If you reference or change the sample code directly, deleting the sample may cause the modification to be lost. If you want to reuse the sample, make a copy and use it.

Sample settings

In this sample, you can try to open the following URL in the browser of PC (Mac), but it can not operate with the browser of PC because “RayKit” application is required.

https://[YOUR INSTANCE or CUSTOM DOMAIN].lightning.force.com/apex/GcBarcodeScannerDemoPage

On the PC browser, the “Read” and “Continuous” buttons are disabled as shown below.

To work with the sample, make this Visualforce page executable from the Salesforce navigation menu.

The next step is to use a PC (Mac) browser.

Salesforce Classic :

  1. Add a Visualforce tab in Settings > Build > Create > Tabs. Example: “Sample 3” tab
  2. Add tabs to the Salesforce navigation menu in Setup > Administration > Mobile Administration > Salesforce Navigation.

Lightning Experience :

  1. Click the gear icon in the upper right corner of the screen.
  2. Add a Visualforce tab in Settings > Platform Tools > User Interface > Tabs. Example: “Sample 3” tab
  3. Add a tab to the Salesforce navigation menu at Setup > Platform Tools > Applications > Mobile Apps > Salesforce > Salesforce Navigation.

Run the sample

You need “RayKit” app to run the sample. For the installation method, please refer to Read barcode with app.

  1. Launch the RayKit app and log in to your Salesforce organization.
  2. Tap the upper left three-line icon.
  3. Scroll down and tap “Sample 3”.
  4. Tap “Read” or “Continuous read”.
  5. Scan the appropriate QR code. In addition, it becomes an error except QR code.
  6. After one reading by the “Read” button or five readings by “Continuous Read”, the screen will be as follows.
Copyright © MESCIUS inc. All rights reserved.