From 58697f6ab92c254311deb6bc517a2f345399e01c Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Wed, 12 Nov 2025 17:45:43 +0000 Subject: [PATCH] chore: update example app --- .../project.pbxproj | 2 + .../Application/ContentView.swift | 7 +- .../Examples/CustomViewExample.swift | 87 ++++++++----------- 3 files changed, 41 insertions(+), 55 deletions(-) diff --git a/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample.xcodeproj/project.pbxproj b/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample.xcodeproj/project.pbxproj index c4cf9fadf6..a8f3367113 100644 --- a/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample.xcodeproj/project.pbxproj +++ b/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample.xcodeproj/project.pbxproj @@ -296,6 +296,7 @@ CODE_SIGN_ENTITLEMENTS = FirebaseSwiftUISample/FirebaseSwiftUISample.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = YYX2P3XVJ7; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = FirebaseSwiftUISample/Info.plist; @@ -331,6 +332,7 @@ CODE_SIGN_ENTITLEMENTS = FirebaseSwiftUISample/FirebaseSwiftUISample.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = YYX2P3XVJ7; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = FirebaseSwiftUISample/Info.plist; diff --git a/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample/Application/ContentView.swift b/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample/Application/ContentView.swift index 293e12dde7..76d10a1a74 100644 --- a/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample/Application/ContentView.swift +++ b/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample/Application/ContentView.swift @@ -25,10 +25,10 @@ import FirebaseOAuthSwiftUI struct ContentView: View { init() { - Auth.auth().useEmulator(withHost: "127.0.0.1", port: 9099) - Auth.auth().settings?.isAppVerificationDisabledForTesting = true - //Auth.auth().signInAnonymously() + Auth.auth().useEmulator(withHost: "127.0.0.1", port: 9099) + let actionCodeSettings = ActionCodeSettings() + actionCodeSettings.handleCodeInApp = true actionCodeSettings.url = URL(string: "https://flutterfire-e2e-tests.firebaseapp.com") actionCodeSettings.setIOSBundleID(Bundle.main.bundleIdentifier!) @@ -55,6 +55,7 @@ struct ContentView: View { .withOAuthSignIn( OAuthProviderSwift( providerId: "oidc.line", + scopes: ["openid", "profile", "email"], displayName: "Sign in with LINE", buttonIcon: Image(.icLineLogo), buttonBackgroundColor: .lineButton, diff --git a/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample/Examples/CustomViewExample.swift b/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample/Examples/CustomViewExample.swift index fa15f6fdbd..370b248525 100644 --- a/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample/Examples/CustomViewExample.swift +++ b/samples/swiftui/FirebaseSwiftUISample/FirebaseSwiftUISample/Examples/CustomViewExample.swift @@ -181,62 +181,45 @@ struct CustomViewExample: View { } private var authenticatedView: some View { - AuthPickerView { - VStack(spacing: 24) { - Spacer() - Image(systemName: "checkmark.circle.fill") - .font(.system(size: 80)) - .foregroundStyle(.green) + VStack(spacing: 24) { + Spacer() + Image(systemName: "checkmark.circle.fill") + .font(.system(size: 80)) + .foregroundStyle(.green) + + VStack(spacing: 8) { + Text("Signed In Successfully") + .font(.title) + .fontWeight(.bold) - VStack(spacing: 8) { - Text("Signed In Successfully") - .font(.title) - .fontWeight(.bold) - - if let email = authService.currentUser?.email { - Text(email) - .font(.body) - .foregroundColor(.secondary) - } else if let phoneNumber = authService.currentUser?.phoneNumber { - Text(phoneNumber) - .font(.body) - .foregroundColor(.secondary) - } + if let email = authService.currentUser?.email { + Text(email) + .font(.body) + .foregroundColor(.secondary) + } else if let phoneNumber = authService.currentUser?.phoneNumber { + Text(phoneNumber) + .font(.body) + .foregroundColor(.secondary) } - - VStack(spacing: 12) { - Button { - authService.isPresented = true - } label: { - Text("Manage Account") - .font(.body) - .fontWeight(.semibold) - .foregroundColor(.white) - .frame(maxWidth: .infinity) - .padding(.vertical, 14) - .background(Color.blue) - .cornerRadius(8) - } - - Button { - Task { - try? await authService.signOut() - } - } label: { - Text("Sign Out") - .font(.body) - .fontWeight(.semibold) - .foregroundColor(.red) - .frame(maxWidth: .infinity) - .padding(.vertical, 14) - .background(Color.red.opacity(0.1)) - .cornerRadius(8) - } + } + + Button { + Task { + try? await authService.signOut() } - .padding(.horizontal, 24) - - Spacer() + } label: { + Text("Sign Out") + .font(.body) + .fontWeight(.semibold) + .foregroundColor(.red) + .frame(maxWidth: .infinity) + .padding(.vertical, 14) + .background(Color.red.opacity(0.1)) + .cornerRadius(8) } + .padding(.horizontal, 24) + + Spacer() } }