Releases: frontegg/frontegg-ios-swift
v1.2.11
v1.2.11
- Social login flow bug fixes
v1.2.10
Web View Enhancement:
- Modified the FronteggWebView's handling of safeAreaInsets. Previously applied universally through a class extension, safe area overrides now specifically target only FronteggWebView This adjustment ensures that zero padding for safe areas is confined to FronteggWebViews, preserving the intended layout for web views created by clients, including those utilized within Ionic/Capacitor applications. Changes implemented by @quesodev. #39
Authentication Update:
- Introduced support for direct login via ASWebAuthentication, streamlining the authentication process.
v1.2.9
We're pleased to announce the release of Frontegg Swift SDK version 1.2.9. This update introduces the loginWithPopup
method, enhancing authentication with ASWebAuthenticationSession
. Here are the key features:
New Features
loginWithPopup
Method: Allows for seamless integration withASWebAuthenticationSession
, offering customizable login experiences. Key parameters include:window
: Specifies the presentation window (defaults to key window).ephemeralSession
: Indicates if the session should be ephemeral (true
by default).loginHint
: Optional login hint (defaults tonil
).loginAction
: Optional login action (defaults tonil
).completion
: Completion handler for post-login actions.
For example usage, refer to our GitHub README.
This version streamlines authentication flows, making them more flexible and user-friendly.
v1.2.8
Add support for UIKit applications
-
Add Frontegg UIKit Wrapper
-
Add Frontegg to the AppDelegate file
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. FronteggApp.shared.didFinishLaunchingWithOptions() return true }
-
Create AuthenticationController class that extends AbstractFronteggController from FronteggSwift
// // AuthenticationController.swift // import UIKit import FronteggSwift class AuthenticationController: AbstractFronteggController { override func navigateToAuthenticated(){ // This function will be called when the user is authenticated // to navigate your application to the authenticated screen let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) // TODO: Set Storyboard ID 'authenticatedScreen' for your authenticated screen let viewController = mainStoryboard.instantiateViewController(withIdentifier: "authenticatedScreen") self.view.window?.rootViewController = viewController self.view.window?.makeKeyAndVisible() } }
-
Create a new ViewController for AuthenticationController:
-
Setup SceneDelegate for Frontegg universal links:
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { if let url = URLContexts.first?.url, url.startAccessingSecurityScopedResource() { defer { url.stopAccessingSecurityScopedResource() } if url.absoluteString.hasPrefix( FronteggApp.shared.baseUrl ) { if(FronteggApp.shared.auth.handleOpenUrl(url)){ // Display your own Authentication View Controller // to handle after oauth callback window?.rootViewController = AuthenticationController() window?.makeKeyAndVisible() return } } } } func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { if let url = userActivity.webpageURL { if(FronteggApp.shared.auth.handleOpenUrl(url)){ // Display your own Authentication View Controller // to handle after oauth callback window?.rootViewController = AuthenticationController() window?.makeKeyAndVisible() return } } }
-
Access authenticated user by
FronteggApp.shared.auth
// // ExampleViewController.swift // import UIKit import SwiftUI import FronteggSwift import Combine class ExampleViewController: UIViewController { // Label to display logged in user's email @IBOutlet weak var label: UILabel! var showLoader: Boolean = true override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. // subscribe to isAuthenticated and navigate to login page // if the user is not authenticated let fronteggAuth = FronteggApp.shared.auth self.label.text = fronteggAuth.user?.email ?? "Unknown" } @IBAction func logoutButton (){ FronteggApp.shared.auth.logout() { _ in window?.rootViewController = AuthenticationController() window?.makeKeyAndVisible() } } }
-
v1.2.7
New Feature
- Support for Social Login Consent Prompt
v1.2.6
v1.2.5
Removed webView.isInspectable = true
for older xcode versions
v1.2.4
- Enhanced functionality to update the selected region during manual initialization in Ionic.
v1.2.3
Made the region configuration initialization function public for use in Ionic frameworks.
v1.2.2
- Removed URL display from the error page.
- Resolved issue where the loading screen remained stuck after authentication via ASWebAuthenticationSession.
- Introduced an option to enable/disable the native bridge for social logins, SAML, and OIDC in embedded mode.
- Added functionality for manual initialization.