🚀 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.
- 🚀 Getting Started - SIWF SDK Demo App
- 📝 Getting Started - SIWF SDK For Your App
- 🛠 Usage For Your App
- 🤝 Contributing
- 📦 Release
Follow these steps to set up and run the Swift app:
If you haven't already, download and install XCode to set up your development environment.
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
Open the example-app
. You should see a package dependency titled Siwf
. If not, add ../
as a local dependency.
- Click ▶ in XCode to run the simulator. It may take a moment to load.
Your SIWF SDK Demo App should now be running! 🚀
iOS 15.0 or later and Swift
When you decide to use the SIWF SDK in your own app, follow the steps below for easy integration:
- Refer to the Demo App for examples of encoded and non-encoded auth requests.
- To create your own, use Frequency's Signed Request Generator.
To use this package in a SwiftPM project, you need to set it up as a package dependency:
- Xcode Instructions
https://github.com/ProjectLibertyLabs/siwf-sdk-ios.git
- Swift Package Manager
.package(url: "https://github.com/ProjectLibertyLabs/siwf-sdk-ios.git", from: "<version>")
Use Siwf.createSignInButton
to create a SIWF Button in your UI:
import Siwf
Siwf.createSignInButton(mode: .dark, authRequest: authRequest)
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-->
}
)
}
}
To contribute:
- Fork the repo and create a feature branch.
- Make changes and test.
- Submit a pull request with details.
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.