TOTPCodeGenerator

public class TOTPCodeGenerator

Use this class to generate the TOTP code for a badge. The TOTP code is 6 digits. The duration of the TOTP code varies by the badge and can be configured on Usher Network Manager. A new code will be generated and published once the current code expires.

  • Designated initializer.

    Declaration

    Swift

    public init(forBadge badge: Badge, delegate: TOTPCodeGeneratorDelegate)
    Parameters
    forBadge

    The badge for which to generate TOTP code

    delegate

    An object that conforms to the TOTPCodeGeneratorDelegate protocol

  • Start generation of TOTP Code. The TOTP code will be generated only if the badge has no active security restrictions.

    Declaration

    Swift

    public func start()
  • Stop the TOTP code generation. It is recommended that the generation be stopped when not required. e.g. code displaying view goes out of screen.

    Declaration

    Swift

    public func stop()