I am using FirebaseAuth to login user through FB. Here is the code:
private FirebaseAuth mAuth;
private FirebaseAuth.AuthStateListener mAuthListener;
pr
Note: From Graph API v8.0 you must provide the access token
for every UserID request you do.
Hitting the graph API:
https://graph.facebook.com//picture?height=1000&access_token=
With firebase:
FirebaseUser user = mAuth.getCurrentUser();
String photoUrl = user.getPhotoUrl() + "/picture?height=1000&access_token=" +
loginResult.getAccessToken().getToken();
You get the token from registerCallback
just like this
LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback() {
@Override
public void onSuccess(LoginResult loginResult) {
FirebaseUser user = mAuth.getCurrentUser();
String photoUrl = user.getPhotoUrl() + "/picture?height=1000&access_token=" + loginResult.getAccessToken().getToken();
}
@Override
public void onCancel() {
Log.d("Fb on Login", "facebook:onCancel");
}
@Override
public void onError(FacebookException error) {
Log.e("Fb on Login", "facebook:onError", error);
}
});
This is what documentation says:
Beginning October 24, 2020, an access token will be required for all UID-based queries. If you query a UID and thus must include a token:
- use a User access token for Facebook Login authenticated requests
- use a Page access token for page-scoped requests
- use an App access token for server-side requests
- use a Client access token for mobile or web client-side requests
We recommend that you only use a Client token if you are unable to use one of the other token types.