Freedom ID#
Introduction#
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! 🚀
Getting Started#
Prerequisites#
Before you begin integrating the Freedom ID SDK into your iOS app, ensure you have the following:An iOS app project with a minimum iOS 12 support.
An API key provided by Freedom Pay.
The Freedom ID SDK .xcframework file provided by Freedom Pay
How to get API KEY and .xcframework file?
In order to get your API KEY and .xcframework you need to contact Freedom Pay providing the following data:Team ID from Apple Developer Concole
Installation Instructions#
Open Project Settings
in Xcode
Go to General
Tab and in Frameworks, Libraries, and Embedded Content
and click +
Select Add Other...
and then Add files...
Choose FreedomID.xcframework
Now you can import SDK and use it further
Usage#
Initialize the SDK#
To initialize the Freedom ID SDK, call the create
method of the FreedomID
class. This method requires one parameter:The API key provided by Freedom ID.
Authorize a User#
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:.failure: Specifies the type of error that occurred.
Clear the SDK#
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.
Authorization Flow#
App Initialization#
When the user opens the app, it automatically checks if there are any accounts tied to their device.Account Check#
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
.
Authentication Screen Interaction#
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
Home Screen Interaction#
On the Home screen, users see their account(s).
Users select an account for which they need to request data permissions and apply fingerprint
Request for Permissions#
After selecting an account, the app presents the Permissions Request Screen
.
Users review the requested permissions (e.g., access to specific user data).
User Decision#
Permissions Granted: The host app is granted the requested permissions.
Permissions Denied: The app returns to the Home Screen
or informs the user that permissions are needed to proceed.
Completion#
Once permissions are granted, the user is notified of successful authorization, and the SDK communicates the result back to the host app.
Data Structures#
DataGrants Structure#