Welcome to the Freedom ID SDK integration guide! This guide will help you smoothly integrate the Freedom ID SDK into your iOS app, enabling secure authentication and user data permission management within the Freedom Holding ecosystem. Freedom ID serves as a single point of entry for users, ensuring top-level security and privacy while managing data permissions and accessing multiple services. The Freedom ID SDK is available for both Android (API level 24 and above) and iOS (12 and above) platforms. This guide specifically covers the iOS platform. Let's get started! 🚀
 To authorize a user, call the authorize method of the FreedomID class. This method initiates the authorization flow. The authorize method takes three parameters:
1.
The UIViewController of your app where the authorization flow will be displayed.
2.
An array of DataGrants that the user needs to grant.
3.
A callback function that will be invoked when the authorization flow completes.
 The authorization process returns an Result object, which can be either:
 To clear the SDK, call the clear method of the FreedomID class.  This method clears the SDK's internal state and releases any resources used during the authorization process.
If an account exists: The user is navigated directly to the Home Screen, where their account(s) are displayed.
If no account exists: The user is taken to the Authentication Screen to log in. After successful authentication, the user is redirected to the Home Screen.
 The user can log in using any of these methods:
Entering their phone number and receiving an OTP code via SMS.
Entering their email and password as credentials.
Entering their phone number and password as credentials.
 Optionally, users can enable 2FA for additional security. To enable 2FA, they need to manage their settings in their Freedom ID account on the web at https://passport.freedompay.kz
 This enum represents a set of permissions that a host application can request from the SDK to grant access to specific profile data. Each constant corresponds to a particular piece of user information, allowing the host app to selectively request access based on its needs. Below is a table describing the different DataGrants available in the Freedom ID SDK:
Enum Constant
Value
Description
readDateOfBirth
read.data_of_birth
Grants access to the user's date of birth
readFirstname
read.firstname
Grants access to the user's first name
readLastname
read.lastname
Grants access to the user's last name
readPatronymic
read.patronymic
Grants access to the user's patronymic
readCountry
read.country
Grants access to the user's country
readNationality
read.nationality
Grants access to the user's nationality
readGender
read.gender
Grants access to the user's gender
readIdentifier
read.identifier
Grants access to the user's identifier such as citizen's ID
 The GrantedProfile data class represents a user's profile information that is accessible after the required read permissions have been granted by the host application via the SDK.
 The TransmissionErrors enum defines a set of possible errors that can occur during the transmission of requests in an authentication or communication process. Each error represents a specific issue related to the request's structure, identification, application integrity, or the process of sending and receiving requests.
 The NetworkError enum defines a set of possible errors that may occur during network operations. Each error represents a specific issue, such as connection failures, stream interruptions, or problems with request/response handling.