Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App switches automatically to limited login when updated to v13 #520

Closed
beliven-davide-lorigliola opened this issue Apr 19, 2024 · 6 comments

Comments

@beliven-davide-lorigliola

I'm using react-native-fbsdk-sdk for facebook login in my application.
I've update react-native-fbsdk-sdk : ^13.0.0

Now my Facebook SSO login opens by default to limited.facebook.com domain.

Here's my code:

import {LoginManager, AccessToken} from 'react-native-fbsdk-next';
import auth from '@react-native-firebase/auth';
import {showErrorIfAllowed} from './functions';

export async function onFacebookButtonPress(onError) {
  try {
    // Attempt login with permissions
    const result = await LoginManager.logInWithPermissions([
      'public_profile',
      'email',
    ]);

    if (result.isCancelled) {
      throw {
        code: '-5',
        name: 'Error',
        message: 'User cancelled the login process',
      };
    }

    // Once signed in, get the users AccesToken
    const data = await AccessToken.getCurrentAccessToken();

    if (!data) {
      throw {
        code: '0',
        name: 'Error',
        message: 'Something went wrong obtaining access token',
      };
    }

    // Create a Firebase credential with the AccessToken
    const facebookCredential = auth.FacebookAuthProvider.credential(
      data.accessToken,
    );

    // Sign-in the user with the credential
    return auth().signInWithCredential(facebookCredential);
  } catch (e) {
    showErrorIfAllowed(e, onError);
  }
}

@brainbicycle
Copy link

brainbicycle commented Apr 20, 2024

this is an upstream change with version 17 of the Facebook iOS SDK: facebook/facebook-ios-sdk#2375 and it sounds like it is a deliberate behavior change by Facebook, if you do not have tracking permissions you automatically get opted into limited login.
So you have a few options:

  • downgrade (harder with privacy manifest requirements)
  • get tracking permissions to use classic login
  • support limited login
  • ask for a change on the iOS sdk on the above issue

either way I don't think there is anything that can be done on this library.

@Daniel3711997
Copy link

question: how do i get 'get tracking permissions to use classic login' this permission ?

@gustavos00
Copy link

question: how do i get 'get tracking permissions to use classic login' this permission ?

I do have the same question. So, if anyone has any information about this, would be very good if you share it :D

@vomchik
Copy link

vomchik commented May 27, 2024

@gustavos00 @Daniel3711997 you can use https://github.com/zoontek/react-native-permissions

Check PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY

@therealyubraj
Copy link
Contributor

therealyubraj commented Nov 27, 2024

Asking for the APP_TRACKING_TRANSPARENCY actually works. Thanks a lot.

@mikehardy
Copy link
Collaborator

👋 just a note that we love documentation PRs, they're easy to make and easy to merge. If there's anything that will help future developers avoid some problem you had, proposing a docs PR is the way to help / pay it forward. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants