docs: getting started for firebaseUI auth iOS for SwiftUI#1328
docs: getting started for firebaseUI auth iOS for SwiftUI#1328russellwheatley wants to merge 1 commit intomainfrom
Conversation
russellwheatley
commented
Mar 20, 2026
- Wrote a getting started document for the latest FirebaseUI iOS SwiftUI to mirror closely the previous: https://firebase.google.com/docs/auth/ios/firebaseui
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new, dedicated getting started guide for FirebaseUI authentication tailored for SwiftUI applications. The document provides developers with clear, step-by-step instructions to integrate and configure various authentication methods, enabling them to quickly implement modern, SwiftUI-first sign-in experiences. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request introduces a new GETTING_STARTED.md documentation file for FirebaseUI for SwiftUI, detailing setup, authentication provider configuration, and usage examples. Review comments identify several issues and improvement opportunities within the provided Swift code snippets: a critical compilation error in the AppDelegate's application(_:open:options:) function due to a missing return statement, a potential runtime crash from force-unwrapping Bundle.main.bundleIdentifier, and a hardcoded APNS token type (.prod) that should ideally be conditional (.sandbox for debug builds). Additionally, the review suggests consolidating duplicated and incomplete AppDelegate examples to improve clarity and prevent confusion.
| open url: URL, | ||
| options: [UIApplication.OpenURLOptionsKey: Any] = [:] | ||
| ) -> Bool { | ||
| Auth.auth().canHandle(url) |
There was a problem hiding this comment.
| let actionCodeSettings = ActionCodeSettings() | ||
| actionCodeSettings.handleCodeInApp = true | ||
| actionCodeSettings.url = URL(string: "https://yourapp.firebaseapp.com") | ||
| actionCodeSettings.setIOSBundleID(Bundle.main.bundleIdentifier!) |
There was a problem hiding this comment.
Force-unwrapping Bundle.main.bundleIdentifier with ! can cause a runtime crash if the value is nil. To promote safer coding practices in this guide, it's better to handle this optional gracefully. For example, you could use guard let to safely unwrap it and provide a clear error message if it's missing.
| _ application: UIApplication, | ||
| didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data | ||
| ) { | ||
| Auth.auth().setAPNSToken(deviceToken, type: .prod) |
There was a problem hiding this comment.
The code hardcodes the APNS token type to .prod, which is intended for production builds submitted to the App Store. During development and testing, the token type should be .sandbox. Using compiler directives to switch between the two based on the build configuration is a common practice and would make this example more robust for developers.
| Auth.auth().setAPNSToken(deviceToken, type: .prod) | |
| #if DEBUG | |
| Auth.auth().setAPNSToken(deviceToken, type: .sandbox) | |
| #else | |
| Auth.auth().setAPNSToken(deviceToken, type: .prod) | |
| #endif |
| ### Handle provider callbacks | ||
|
|
||
| If you use Google Sign-In, Facebook Login, phone authentication, or email link flows, add the required URL handling to your app delegate. |
There was a problem hiding this comment.
This section provides a more complete implementation for handling provider callbacks, which is great. However, a different and incomplete version is provided earlier under the 'Phone number' section (lines 177-184), which also contains a compilation error. This duplication can be confusing. To improve clarity, consider consolidating the AppDelegate examples into a single, comprehensive section that developers can refer to for all provider-related URL handling.