Badge

public class Badge : ModelObject

Representation of an Usher Badge.

  • id

    Badge ID.

    Declaration

    Swift

    @objc
    public private(set) dynamic var id: String
  • User’s email address.

    Declaration

    Swift

    @objc
    public private(set) dynamic var email: String
  • User’s full name.

    Declaration

    Swift

    @objc
    public private(set) dynamic var fullName: String
  • User’s first name.

    Declaration

    Swift

    @objc
    public private(set) dynamic var firstName: String
  • User’s last name.

    Declaration

    Swift

    @objc
    public private(set) dynamic var lastName: String
  • User’s title.

    Declaration

    Swift

    @objc
    public private(set) dynamic var title: String
  • User group.

    Declaration

    Swift

    @objc
    public private(set) dynamic var group: String
  • Badge name.

    Declaration

    Swift

    @objc
    public private(set) dynamic var badgeName: String
  • Organization name.

    Declaration

    Swift

    @objc
    public private(set) dynamic var organizationName: String
  • Organization ID.

    Declaration

    Swift

    @objc
    public private(set) dynamic var organizationId: String
  • Tech Support phone number.

    Declaration

    Swift

    @objc
    public private(set) dynamic var supportPhone: String
  • Boolean that indicates if the badge is revoked.

    Declaration

    Swift

    @objc
    public private(set) dynamic var revoked: Bool
  • Boolean that indicates if the badge needs credential authentication.

    Declaration

    Swift

    @objc
    public private(set) dynamic var needsCredentialAuth: Bool
  • Boolean that indicates if Touch ID authentication is enabled for the badge.

    Declaration

    Swift

    @objc
    public private(set) dynamic var touchIdEnabled: Bool
  • Boolean that indicates if passcode authentication is enabled for the badge.

    Declaration

    Swift

    @objc
    public private(set) dynamic var passcodeEnabled: Bool
  • Boolean that indicates if the badge has beacons associated with it.

    Declaration

    Swift

    @objc
    public private(set) dynamic var hasBeacons: Bool
  • Boolean that indicates if the badge has admin previlages.

    Declaration

    Swift

    @objc
    public private(set) dynamic var isAdminBadge: Bool
  • Boolean that indicates if records of generic code (Non-usher QR code) scans made using this badge should be saved.

    Declaration

    Swift

    @objc
    public private(set) dynamic var recordGenericCodeScan: Bool
  • Boolean that indicates if the badge requires access to the user’s location data while the app is in foreground and in use.

    Declaration

    Swift

    @objc
    public private(set) dynamic var requiresLocationWhileUsing: Bool
  • Boolean that indicates if the badge requires access to the user’s location data even when the app is not in use and is running in the background.

    Declaration

    Swift

    @objc
    public private(set) dynamic var requiresLocationAlways: Bool
  • Boolean that indicates if the badge requires access to the device’s bluetooth connection and if bluetooth should be turned on to use the badge.

    Declaration

    Swift

    @objc
    public private(set) dynamic var requiresBluetooth: Bool
  • Boolean that indicates if the user is required to set a profile photo for the badge.

    Declaration

    Swift

    @objc
    public private(set) dynamic var requiresPhoto: Bool
  • Boolean that indicates if a profile photo is already set for the badge.

    Declaration

    Swift

    @objc
    public private(set) dynamic var photoAvailable: Bool
  • The identifier to identify whether profile image has been updated.

    Declaration

    Swift

    @objc
    public private(set) dynamic var photoChecksum: String
  • The badge’s terms of use acceptance requirement. See BadgeTOUAcceptance for options.

    Declaration

    Swift

    @objc
    public private(set) dynamic var termsOfUseAcceptance: BadgeTOUAcceptance
  • The badge’s privacy policy acceptance requirement. See BadgePPAcceptance for options.

    Declaration

    Swift

    @objc
    public private(set) dynamic var privacyPolicyAcceptance: BadgePPAcceptance
  • URL to the badge’s terms of use.

    Declaration

    Swift

    @objc
    public private(set) dynamic var termsOfUseURL: String
  • URL to the badge’s privacy policy.

    Declaration

    Swift

    @objc
    public private(set) dynamic var privacyPolicyURL: String
  • Number of physical access keys associated with the badge.

    Declaration

    Swift

    @objc
    public private(set) dynamic var keyCount: Int
  • The method to be used for provisioning the device for the badge. See DeviceProvisioningMethod for the list of options.

    Declaration

    Swift

    @objc
    public private(set) dynamic var deviceProvisioningMethod: DeviceProvisioningMethod
  • The date from which the device must be provisioned (i.e. verified) for this badge to continue being usable.

    Declaration

    Swift

    @objc
    public private(set) dynamic var deviceProvisioningStartTime: Double
  • Length of the device provisoning code that will be sent by the server.

    Declaration

    Swift

    @objc
    public private(set) dynamic var deviceProvisioningCodeLength: Int
  • Indicates if the device has been approved by an administrator for holding the badge. Value 0 means device is not approved and value 1 means device is approved.

    Declaration

    Swift

    @objc
    public private(set) dynamic var deviceApproved: Int
  • Indicates if the device has been provisioned and verified to hold the badge. Value 0 means device is not verified and value 1 means device is verified.

    Declaration

    Swift

    @objc
    public private(set) dynamic var deviceVerified: Int
  • The phone number entered and verified for the badge.

    Declaration

    Swift

    @objc
    public private(set) dynamic var enrolledPhoneNumber: String
  • The time interval between consecutive Touch ID authentication requests. Once authenticated the badge with Touch ID, the badge can be used without further Touch ID verification until this time interval has elapsed. The value is in seconds.

    Declaration

    Swift

    @objc
    public private(set) dynamic var touchIdVerificationInterval: Int
  • The time interval between consecutive passcode authentication requests. Once authenticated the badge with passcode, the badge can be used without further passcode verification until this time interval has elapsed. The value is in seconds.

    Declaration

    Swift

    @objc
    public private(set) dynamic var passcodeVerificationInterval: Int
  • The prefered Usher security code to display in the non-detailed views of the badge. See SecurityCodeType for a list of options.

    Declaration

    Swift

    public var codeDisplayType: SecurityCodeType { get }
  • How often the Usher security code should be refreshed. This value is in seconds.

    Declaration

    Swift

    @objc
    public private(set) dynamic var usherCodeInterval: Double
  • The length of one time use password.

    Declaration

    Swift

    @objc
    public private(set) dynamic var totpCodeLength: Int
  • The interval at which a new one time use password should be generated. This value is in seconds.

    Declaration

    Swift

    @objc
    public private(set) dynamic var totpCodeInterval: Double
  • Boolean that indicates if the badge supports generation and use of one time use passwords.

    Declaration

    Swift

    @objc
    public private(set) dynamic var totpCodeSupported: Bool
  • List of time windows valid for the badge to be used. The list is of type RealmSwift.List<TimeCondition>. See TimeCondition for detail.

    Declaration

    Swift

    public let timeConditions: List<TimeCondition>
  • List of locations where the badge can be used. The list is of type RealmSwift.List<LocationCondition>. See LocationCondition for detail.

    Declaration

    Swift

    public let locationConditions: List<LocationCondition>
  • List of locations where the badge can report its location. The list is of type RealmSwift.List<LocationCondition>. See LocationCondition for detail.

    Declaration

    Swift

    public let telemetryConditions: List<LocationCondition>
  • List of all devices currently provisioned to hold the badge. The list is of type RealmSwift.List<ProvisionedDevice>.

    Declaration

    Swift

    public let provisionedDevices: List<ProvisionedDevice>
  • The badge’s background image URL string. If background image is not set for the badge, the value of this property will be an empty string.

    Declaration

    Swift

    @objc
    public private(set) dynamic var badgeBackground: String
  • The identifier to identify whether badge background has been updated.

    Declaration

    Swift

    @objc
    public private(set) dynamic var badgeBackgroundChecksum: String
  • The badge’s icon image URL string. If icon image is not set for the badge, the value of this property will be an empty string.

    Declaration

    Swift

    @objc
    public private(set) dynamic var badgeIcon: String
  • The identifier to identify whether badge icon has been updated

    Declaration

    Swift

    @objc
    public private(set) dynamic var badgeIconChecksum: String
  • Hex code for the badge’s color. If the badge color is not set, the value of this property will be an empty string.

    Declaration

    Swift

    @objc
    public private(set) dynamic var badgeColor: String
  • The date the badge was issued to the user.

    Declaration

    Swift

    @objc
    public private(set) dynamic var issuedDate: Date?
  • List of properties defined by the server that can be displayed by the app. The display name, order and visibility of these properties is defined in Network Manager.

    Declaration

    Swift

    public var visibleAdditionalProperties: [(BadgeProperty)] { get }
  • Boolean that is true if the deviceProvisioningStartTime has not passed yet.

    Declaration

    Swift

    @objc
    public dynamic var inDeviceProvisioningGracePeriod: Bool { get }
  • Formated display representation of issuedDate for the current locale of the device. The date have the format MMM dd, yyyy

    Declaration

    Swift

    public var issuedDateString: String { get }
  • Boolean indicates if phone number enrollment is pending. The value will be true only if device provisioning by phone is required (see deviceProvisioningMethod) and enrolledPhoneNumber is empty

    Declaration

    Swift

    public var phoneEnrollmentPending: Bool { get }
  • Boolean indicates if phone number enrollment or verification is pending. The value will be true only if device provisioning by phone is required (see deviceProvisioningMethod), and either deviceApproved is equal to 0, deviceVerified is equal to 0 or enrolledPhoneNumber is empty

    Declaration

    Swift

    public var phoneEnrollmentOrVerificationPending: Bool { get }
  • Boolean that indicates if the badge can display its list of provisioned devices on the current device. The value is true only if the badge is not revoked, doesn’t need credential authentication and is not pending for phone number enrollment or verification.

    Declaration

    Swift

    public var validForDevicePopulation: Bool { get }
  • Index that can be used for ordering badges on a device.

    Note

    This value is stored only locally on the device and not persisted on the server.
    Declaration

    Swift

    @objc
    public dynamic var badgeIndex: Int
  • Boolean that indicates if the user has already authorized the SDK to track location.

    Declaration

    Swift

    @objc
    public internal(set) dynamic var authorizedToTrackLocation: Bool
  • Boolean that indicates if the user has already accepted the badge’s term of use.

    Declaration

    Swift

    @objc
    public internal(set) dynamic var termsOfUseAccepted: Bool
  • Boolean that indicates if the user has already accepted the badge’s privacy policy.

    Declaration

    Swift

    @objc
    public internal(set) dynamic var privacyPolicyAccepted: Bool
  • Converts a Badge to a CNContact object. This method can be used for saving a user’s information to the iOS Contacts app.

    Declaration

    Swift

    public func cnContactWith(profilePicture: UIImage?) -> CNContact
    Parameters
    profilePicture

    Downloaded profile image of the user.

    Return Value

    CNContact representation of the badge.

  • Creates a placeholder UIImage from the initials of the user’s full name, to be used in cases where profile image is not set for the badge or during slow network connections while the profile picture is being downloaded from the server.

    Declaration

    Swift

    public func placeholderProfilePicture(backgroundColor: UIColor = UIColor(white: 0, alpha: 0.2)) -> UIImage?
    Parameters
    backgroundColor

    optional background color

    Return Value

    UIImage form of the upper case initials of the user’s full name.