Skip to content

ProjectLibertyLabs/siwf-sdk-ios

Repository files navigation

Sign-In With Frequency (SIWF) SDK For iOS

🚀 Sign-In With Frequency (SIWF) is an authentication SDK designed for seamless integration with mobile apps.

This repository contains the local SIWF SDK and Demo App, for seamless spinup and as a reference for how to use the SIWF SDK in your app.

📌 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 [email protected]: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:

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.

About

SIWF SDK for iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages