Skip to content

Commit 48c1b24

Browse files
refactor: make instance non-nullable
1 parent 37970aa commit 48c1b24

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Services/AuthService+Facebook.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import FirebaseAuthSwiftUI
1010
public extension AuthService {
1111
@discardableResult
1212
func withFacebookSignIn(scopes scopes: [String]? = nil) -> AuthService {
13-
FacebookProviderAuthUI.configureSharedInstance(scopes: scopes)
13+
FacebookProviderAuthUI.configureProvider(scopes: scopes)
1414
register(provider: FacebookProviderAuthUI.shared)
1515
return self
1616
}

FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Services/FacebookProviderAuthUI.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,14 @@ public class FacebookProviderAuthUI: FacebookProviderAuthUIProtocol {
2727
// Needed for reauthentication
2828
var isLimitedLogin: Bool = true
2929

30-
@MainActor private static var _shared: FacebookProviderAuthUI?
30+
@MainActor private static var _shared: FacebookProviderAuthUI =
31+
.init(scopes: kDefaultFacebookScopes)
3132

3233
@MainActor public static var shared: FacebookProviderAuthUI {
33-
guard let instance = _shared else {
34-
fatalError("`FacebookProviderAuthUI` has not been configured")
35-
}
36-
return instance
34+
return _shared
3735
}
3836

39-
@MainActor public static func configureSharedInstance(scopes: [String]? = nil) {
37+
@MainActor public static func configureProvider(scopes: [String]? = nil) {
4038
_shared = FacebookProviderAuthUI(scopes: scopes)
4139
}
4240

0 commit comments

Comments
 (0)