RSDStandardPermission

public final class RSDStandardPermission : NSObject, RSDPermission, Codable

A Codable struct that can be used to store messaging information specific to the use-case specific to the associated activity, task, or step.

  • Default initializer.

    Declaration

    Swift

    public init(permissionType: RSDStandardPermissionType, title: String? = nil, reason: String? = nil, deniedMessage: String? = nil, restrictedMessage: String? = nil, requestIfNeeded: Bool = true, isOptional: Bool = false)
  • The permission type for this permission.

    Declaration

    Swift

    public let permissionType: RSDStandardPermissionType
  • Declaration

    Swift

    public var identifier: String { get }
  • A title for this permission.

    Declaration

    Swift

    public let title: String?
  • Additional reason for requiring the permission.

    Declaration

    Swift

    public let reason: String?
  • Should the step request the listed permissions before continuing to the next step? (Default == true)

    This flag can be used to optionally show an instruction step that will display information to a user concerning why a permission is being requested. This is allowed to add additional clarity to the user about the requirements of a given task that cannot be explained satisfactorily by the OS alert.

    Declaration

    Swift

    public var requestIfNeeded: Bool { get }
  • Is the permission optional for a given task? (Default == false, ie. required)

    • example:

    Test A requires the motion sensors to calculate the results, in which case this permission should be required and the participant should be blocked from performing the task if the permission is not included.

    Test B uses the motion sensors (if available) to inform the results but can still receive valuable information about the participant without them. In this case, the permission is optional and the participant should be allowed to continue without permission to access the motion sensors.

    Declaration

    Swift

    public var isOptional: Bool { get }
  • The message to show when displaying an alert that the user cannot run a step or task because their access is restricted.

    Declaration

    Swift

    public var restrictedMessage: String { get }
  • The message to show when displaying an alert that the user cannot run a step or task because their access is denied.

    Declaration

    Swift

    public var deniedMessage: String { get }
  • Returns the message appropriate to the status.

    Declaration

    Swift

    public func message(for status: RSDAuthorizationStatus) -> String?