iOS SIWF SDK

Quick Reference

1. Installation

Requirements

  • iOS 15.0 or later
  • Swift Package Manager

Installing the SIWF SDK

You can install the SIWF SDK via Swift Package Manager (SPM):

  1. Open Xcode and navigate to File → Add Packages.
  2. Enter the repository URL:
    https://github.com/ProjectLibertyLabs/siwf-sdk-ios.git
    
  3. Select the latest stable version and add it to your project.

Xcode Documentation Reference

2. Displaying the SIWF Button

To create a SIWF Button, use the Siwf.createSignInButton method:

import Siwf

Siwf.createSignInButton(mode: .primary, authRequest: authRequest)

authRequest requires the Signed Request Payload in either base64url encoded or structured form.

3. Handling Authorization Callbacks

Use onOpenURL and Siwf.handleRedirectUrl to handle deep links and retrieve the authentication code.

4. Process Authorization Code

On your backend service, process the authorization code and start your session.

Resources: