ShareID
  • SDKs
    • Web
    • iOS
    • Android
    • Flutter
    • React Native
  • Photo-based authenticity API
  • Get a Token
    • Get a Token - Onboarding
    • Get a Token - Authenticate
  • Get the Analysis Result
    • Get Result - Onboarding
    • Get Result - Authenticate
  • AI Analysis Result
    • Analysis Result - Onboarding
    • Analysis Result - Authenticate
  • Message Handler
  • Changelog
    • SDK Web
    • SDK iOS
    • SDK Android
    • Photo-based authenticity API
  • Terminology
  • Api
  • FAQ
Powered by GitBook
On this page
  • Getting started
  • 1. Set up the SDK
  • 2. Get a token
  • 3. Start an onboarding or authenticate flow
  • 4. Get the user workflow result from SDK
  • 5. Get the analysis result
  • Customisation
  • Configuration
  • Localisation
  • FAQ
Edit on GitHub
  1. SDKs

iOS

This is a walkthrough of how you can integrate the Onboarding or Authenticate SDK for iOS applications.

PreviousWebNextAndroid

Last updated 4 days ago

Latest version:

Getting started

In order to perform an Onboarding or an Authenticate, you should follow those steps:

  1. : install and import the SDK

  2. : request a token using your business credentials

  3. : launch a user workflow

  4. : use the Message handler to get insights about the user workflow

  5. : use your callback or the endpoint to get the analysis result

1. Set up the SDK

1.1. Project requirements

The proper functioning of the SDK necessitates the provision of several parameters. These parameters are essential for enabling the full range of functionalities offered by the SDK.

  • iOS 15+ (because of Swift minimum version)

  • Available for iPhone and iPad in portrait mode only

Mandatory app permission

The SDK uses the device's camera functionality.

You must add NSCameraUsageDescription within your application's Info.plist file (see ).

1.2. Install SDK

To securely manage your credentials, you’ll need to create a .netrc file in your home directory with the necessary login details.

  1. Create and open

Type touch ~/.netrc & open ~/.netrc

  1. Add login details

machine repository.shareid.net
login <your-repository-username>
password <your-repository-password>
  1. Set file permissions

chmod 600 ~/.netrc

1.3. Add the dependency

To install the SDK with CocoaPods, you'll need to add the dependency to your Podfile. (if it doesn't exist, create one by running the following command in your project directory: pod init)

  1. Add the following to your target

platform :ios, '15.0'

target '<your-app>' do
  use_frameworks!
  pod 'shareid-sdk-ios' # or specific version
end
  1. Run pod install to install the dependency

  2. Now, you can import and use the SDK in your project

import shareid_sdk_ios

2. Get a token

Use the credentials you received from ShareID's team to get an authentication token and launch an onboarding or authenticate workflow.

3. Start an onboarding or authenticate flow

Once you have added the SDK as a dependency and have your credentials, you can configure the SDK.

ShareID.shared.start(service: "<service>", token: "<your-token>")

The service specifies the service in the SDK:

  • onboarding starts the onboarding process

  • authenticate starts the authenticate process

The initial SDK screen is automatically triggered upon execution of the method above.

4. Get the user workflow result from SDK

To receive feedback from the SDK, you need to implement the messageHandler closure, which manages various responses from the ShareID process.

This closure is triggered when the ShareID SDK completes an operation, fails, or encounters an error.

ShareID.shared.messageHandler = { (result: ShareID.Result) in
      switch result.type {
            case .success:
                  // ...
            case .exit:
                  // ...
            case .failure:
                  // ...
      }
}

5. Get the analysis result

When the processing of an onboarding or authenticate request is finished, you may receive the result through the callback if you provided it. You may also, fetch yourself the result by calling our API.

Customisation

The ShareID iOS SDK is built to be highly customisable, allowing for flexibility through various configuration options or by applying themes to adapt the user interface to your needs.

Configuration

To customise the SDK, pass a ShareID.Theme after building the flow.

ShareID.shared.theme = ShareID.Theme.init()

Set the colors

theme.colors.primary = ...
theme.colors.secondary = ...

Name

Message

Color

primary

The main color

ShareID blue (if nothing defined)

secondary

The main title text color

Black or White (depending on your iPhone theme and if nothing is set)

The SDK uses the device language, but you can use the language parameter to force a language before initialising the SDK.

ShareID.shared.language = .en

As soon as an error is returned by the SDK, an error screen is automatically displayed. Change the shouldShowError parameter if you want to stop displaying them.

ShareID.shared.shouldShowError = false

Disabling this parameter exposes the SDK to potential malfunctions. Make sure you handle errors in your application by following what the response handler returns.

The SDK doesn't display logs in the console by default, but you can decide to display them by setting the verbose variable to true.

ShareID.shared.verbose = true

Localisation

Languages supported:

  • 🇸🇦 (ar), 🇩🇪 (de), 🇬🇧 (en), 🇪🇸 (es), 🇫🇷 (fr), 🇮🇹 (it), 🇵🇱 (pl), 🇵🇹 (pt), 🇷🇴 (ro), 🇷🇺 (ru)

Be sure to add CFBundleLocalizations to your Info.plist file with all the languages you want to support in your application. (This ensures that default Apple buttons are properly localised and enables RTL navigation)

FAQ

Why do I get a "Sandbox: rsync.samba(XXXXX) deny(1) file-read-data..." error?

In Xcode 15, a new feature called User Script Sandboxing has been introduced to enhance build stability and security by preventing scripts from making unintended changes to the system. When enabled, the build system restricts user scripts from using undeclared input/output dependencies. However, this can cause issues with the ShareID SDK, which requires running scripts to dynamically link dependencies.

To fix this issue:

  1. Go to Build Settings > Build Options.

  2. Set the User Script Sandboxing option to No.


Technical support and contact 💬

ShareID supports with authenticate handled via a .netrc file.

Depending on the SDK you are integrating (Onboarding/Authenticate), you may use an API here

To view all possible end-of-process results in our SDK, please refer to the for all success, exit and failure states.

See for more details.

CocoaPods
Get a Token
Message Handler
Get the analysis result
support@shareid.ai
2.4.7
Apple documentation
Set up the SDK
Get a token
Start an onboarding or authenticate flow
Get the user workflow result from SDK
Get the Analysis result