Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!)
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
Loading