File tree Expand file tree Collapse file tree
FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Views Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import AppTrackingTransparency
12import FacebookCore
23import FacebookLogin
34import FirebaseAuth
@@ -75,7 +76,10 @@ extension FacebookButtonView: View {
7576 if let error = error {
7677 errorMessage = authService. string. localizedErrorMessage ( for: error)
7778 } else {
78- if limitedLogin {
79+ // if not authorized, Facebook will default to limited login and classic login will fail
80+ let trackingStatus = ATTrackingManager . trackingAuthorizationStatus
81+
82+ if limitedLogin || trackingStatus != . authorized {
7983 await limitedLogin ( )
8084 } else {
8185 await classicLogin ( )
@@ -104,7 +108,7 @@ struct FacebookLoginButtonView: UIViewRepresentable {
104108
105109 @MainActor func loginButtonWillLogin( _ loginButton: FBLoginButton ) -> Bool {
106110 loginButton. loginTracking = parent. isLimitedLogin ? . limited : . enabled
107- // loginButton.permissions = ["public_profile", "email"]
111+ loginButton. permissions = [ " public_profile " , " email " ]
108112
109113 loginButton. nonce = parent. shaNonce
110114
You can’t perform that action at this time.
0 commit comments