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 @@ -29,7 +29,8 @@ public protocol AuthProviderUI {

public protocol PhoneAuthProviderSwift: AuthProviderSwift {
@MainActor func verifyPhoneNumber(phoneNumber: String) async throws -> String
@MainActor func createAuthCredential(verificationId: String, verificationCode: String) async throws -> AuthCredential
@MainActor func createAuthCredential(verificationId: String,
verificationCode: String) async throws -> AuthCredential
}

public enum AuthenticationState {
Expand Down Expand Up @@ -109,7 +110,10 @@ public final class AuthService {
public init(configuration: AuthConfiguration = AuthConfiguration(), auth: Auth = Auth.auth()) {
self.auth = auth
self.configuration = configuration
string = StringUtils(bundle: configuration.customStringsBundle ?? Bundle.module, languageCode: configuration.languageCode)
string = StringUtils(
bundle: configuration.customStringsBundle ?? Bundle.module,
languageCode: configuration.languageCode
)
listenerManager = AuthListenerManager(auth: auth, authEnvironment: self)
FirebaseApp.registerLibrary("firebase-ui-ios", withVersion: FirebaseAuthSwiftUIVersion.version)
}
Expand Down Expand Up @@ -427,7 +431,19 @@ public extension AuthService {
throw AuthServiceError
.invalidEmailLink("email address is missing from app storage. Is this the same device?")
}
let link = url.absoluteString
let urlString = url.absoluteString

guard let originalLink = CommonUtils.getQueryParamValue(from: urlString, paramName: "link")
else {
throw AuthServiceError
.invalidEmailLink("'link' parameter is missing from the email link URL")
}

guard let link = originalLink.removingPercentEncoding else {
throw AuthServiceError
.invalidEmailLink("Failed to decode Link URL")
}

guard let continueUrl = CommonUtils.getQueryParamValue(from: link, paramName: "continueUrl")
else {
throw AuthServiceError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"FirebaseSwiftUIExample/Preview Content\"";
DEVELOPMENT_TEAM = 3G33A99C47;
DEVELOPMENT_TEAM = YYX2P3XVJ7;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = FirebaseSwiftUIExample/Info.plist;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ struct ContentView: View {
Auth.auth().signInAnonymously()
let actionCodeSettings = ActionCodeSettings()
actionCodeSettings.handleCodeInApp = true
actionCodeSettings
.url = URL(string: "https://flutterfire-e2e-tests.firebaseapp.com")
actionCodeSettings.linkDomain = "flutterfire-e2e-tests.firebaseapp.com"
actionCodeSettings.url = URL(string: "https://flutterfire-e2e-tests.firebaseapp.com")
actionCodeSettings.setIOSBundleID(Bundle.main.bundleIdentifier!)
actionCodeSettings.linkDomain = "flutterfire-e2e-tests.firebaseapp.com"
let configuration = AuthConfiguration(
shouldAutoUpgradeAnonymousUsers: true,
tosUrl: URL(string: "https://example.com/tos"),
Expand Down Expand Up @@ -110,9 +109,6 @@ struct ContentView: View {
}
.navigationTitle("Firebase UI Demo")
}
.onAppear {
authService.isPresented = authService.authenticationState == .unauthenticated
}
.onChange(of: authService.authenticationState) { _, newValue in
debugPrint("authService.authenticationState - \(newValue)")
if newValue != .authenticating {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:flutterfire-e2e-tests.firebaseapp.com</string>
<string>applinks:flutterfiretests.page.link</string>
</array>
</dict>
</plist>
Loading