Ping SDKs

Set up QR code handling

Applies to:

  • Ping SDK for Android

  • Ping SDK for iOS

  • Ping SDK for JavaScript

The Ping SDK for JavaScript has the following methods for handling QR codes:

FRQRCode.isQRCodeStep(step)

For determining if a step requires a QR code.

FRQRCode.getQRCodeData(step)

For extracting the QR code data from the step, such as the URI.

Example:

// Import the module
import { FRQRCode } from ‘@forgerock/javascript-sdk’;

// Determine if a step is a QR code step
const isQRCode: boolean = FRQRCode.isQRCodeStep(step);

if (isQRCode) {
  // Extract QR code data
  const data: {
    message: string,
    use: string,
    uri: string
  } = FRQRCode.getQRCodeData(step);

  // Render a QR code using the `data` from the step

}