Contents

projectlibertylabs/siwf-sdk-ios

πŸš€ **[Sign-In With Frequency (SIWF)](https://github.com/ProjectLibertyLabs/siwf)** is an authentication SDK designed for seamless integration with mobile apps.

πŸ“Œ **Index**

  1. πŸš€ Getting Started - SIWF SDK Demo App
  2. πŸ“ Getting Started - SIWF SDK For Your App
  3. πŸ›  Usage For Your App
  4. 🀝 Contributing
  5. πŸ“¦ Release

πŸš€ **Getting Started - SIWF SDK Demo App**

Follow these steps to set up and run the Swift app:

1️⃣ Install XCode

If you haven't already, download and install XCode to set up your development environment.

2️⃣ Clone the Repository

Run the following command in your terminal to clone the repository:

git clone git@github.com:ProjectLibertyLabs/siwf-sdk-ios.git
cd siwf-sdk-ios/example-app

3️⃣ Open the Project in XCode

Open the example-app. You should see a package dependency titled Siwf. If not, add ../ as a local dependency.

4️⃣ Run the App

  • Click β–Ά in XCode to run the simulator. It may take a moment to load.

Your SIWF SDK Demo App should now be running! πŸš€

πŸ“ **Getting Started - SIWF SDK For Your App**

βš™οΈ Requirements

iOS 15.0 or later and Swift

πŸ›  **Usage For Your App**

When you decide to use the SIWF SDK in your own app, follow the steps below for easy integration:

1️⃣ Define the SIWF Authentication Details

2️⃣ πŸš€ Installation

To use this package in a SwiftPM project, you need to set it up as a package dependency:

- https://github.com/ProjectLibertyLabs/siwf-sdk-ios.git

- .package(url: "https://github.com/ProjectLibertyLabs/siwf-sdk-ios.git", from: "<version>")

2️⃣ Display the SIWF Sign-In Button

Use Siwf.createSignInButton to create a SIWF Button in your UI:

    import Siwf

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

3️⃣ Handle Authorization Callbacks

OnOpenURL, use Siwf.handleRedirectUrl() to listen for the deep link(siwfdemoapp://login) and handle the authorization callback.

    Siwf.createSignInButton(authRequest: authRequest)
    .onOpenURL { url in
        guard let redirectUrl = URL(string: "siwfdemoapp://login") else {
            print("❌ Error: Invalid redirect URL.")
            return
        }
        Siwf.handleRedirectUrl(
            incomingUrl: url,
            redirectUrl: redirectUrl,
            processAuthorization: { authorizationCode in
                print("βœ… Successfully extracted authorization code: \(authorizationCode)")
                <!--Process the authorizationCode by sending it it your backend servers-->
                <!--See https://projectlibertylabs.github.io/siwf/v2/docs/Actions/Response.html-->
            }
        )
    }
}

🀝 **Contributing**

To contribute:

  • Fork the repo and create a feature branch.
  • Make changes and test.
  • Submit a pull request with details.

πŸ“¦ **Release**

Releases are managed via GitHub Releases.

Swift Packages are based on the tag generated from the release and the code at that tag. No artifacts beyond the code are required.

Package Metadata

Repository: projectlibertylabs/siwf-sdk-ios

Default branch: main

README: README.md