For the complete documentation index, see llms.txt. This page is also available as Markdown.

Terms and conditions

This component requires a minimum iOS version of iOS13

Introduction

Acceptance of the terms and conditions of use is carried out through the TermsConditions Component.

This component is responsible for managing the capture of the user's response to some terms and conditions of use. Its main processes are:

  • Launching an HTML text viewer.

  • Capturing the user's response.

In the section of Simplified Launch the steps necessary for the basic Integration of the SDK are detailed. This section adds specific information for launching this component.


Dependencies

To avoid conflicts and compatibility issues, if you want to install the component in a project that contains an old Version of the Facephi libraries, they must be completely removed before installing the components of SDK Mobile.

CocoaPods

  • The mandatory dependencies that must have been previously installed (by adding them to the file Podfile of the project) are:

pod 'FPHISDKMainComponent', '~> $VERSION'
  • To install the terms and conditions of use component, add the following dependency in the Podfile of the project:

pod 'FPHISDKTermsConditionsComponent', '~> $VERSION'

Swift Package Manager (SPM)

  • The mandatory dependencies that must have been installed previously are:

  • To install the terms and conditions of use component, include it in the project modules:


Available controllers

Controller

Description

TermsConditionsController

Main controller for capturing terms acceptance


Simplified Launch

Once the SDK is started and a new operation is created, the component can be launched using its main controller.


Basic configuration

To launch the component, an object must be created TermsConditionsConfigurationData, which defines the controller configuration.

The basic configuration required is as follows:

The available parameters are:

  • termsConditions: HTML text of the terms and conditions of use to be displayed to the user.

  • extractionTimeout: maximum allowed time to complete the process.

  • orientation: orientation of the SDK screen.


Receiving the result

The launch will return the information in SdkResult. A distinction can be made between a successful launch and an unsuccessful one.

Receiving errors

In the error section, the common class ErrorType.

List of errors:

  • TER_APPLICATION_CONTEXT_ERROR: The required application context is null.

  • TER_CANCEL_BY_USER: The user has canceled the process.

  • TER_CANCEL_LAUNCH: A general cancellation of the SDK has been performed.

  • TER_COMPONENT_LICENSE_ERROR: The component License is not correct.

  • TER_EMPTY_LICENSE: The License String is empty.

  • TER_FLOW_ERROR: Error in the flow process.

  • TER_INITIALIZATION_ERROR: Initialization error.

  • TER_MANAGER_NOT_INITIALIZED: The managers are null.

  • TER_NO_DATA_ERROR: The input data is null.

  • TER_OPERATION_NOT_CREATED: There is no operation in progress.

  • TER_PERMISSION_DENIED: The user has rejected the permissions.

  • TER_TIMEOUT: Timeout in the process.

  • TER_UNKNOWN_ERROR: Unknown error.

Reception of the correct result - data

In the part of SdkResult.Success - data, we will have the class TermsConditionsResult.

TermsConditionsResult does not expose additional fields. If the user accepts the terms, the component returns a successful result; if they reject them, it returns an error OTHER("USER_REJECTED_TERMS_AND_CONDITIONS").


Advanced information

Advanced component configuration

To launch the component, an object must be created TermsConditionsConfigurationData.

The fields of this class are detailed below:

  • termsConditions: terms and conditions of use text to be displayed to the user.

  • extractionTimeout: sets the maximum time that the capture can take.

  • orientation: orientation of the SDK interface.


Component customization

In addition to the changes that can be made at the SDK level, this component allows Customization of its interface through the iOS wrapper theme system.

Theme

Visual Customization is defined by ThemeTermsConditionsProtocol.

The available themes in the wrapper are:

  • ThemeTermsConditions: default theme of the component.

  • ThemeTermsConditionsFlow: theme applied when external Customization is resolved.

The color and dimension resources of the component are resolved from the keys of the SDK customization system:

  • sdkPrimaryColor

  • sdkSecondaryColor

  • sdkBackgroundPrimaryColor

  • sdkErrorColor

  • sdkSuccessColor

  • sdkNeutralColor

  • sdkAccentColor

  • sdkTitleTextColor

  • sdkBodyTextColor

  • sdkTopIconsColor

  • sdkButtonTextColor

The available configurable dimension is:

  • radiusCorner


Last updated