-
Notifications
You must be signed in to change notification settings - Fork 36
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
How to convert a newMeRequest() call to use RetroFacebook #42
Comments
Hi @loudenvier , You can use the following lines to login with needed permissions: final Facebook facebook = Facebook.create(activity);
loginButton.setOnClickListenter(v -> {
facebook.logInWithReadPermissions(Arrays.asList("public_profile",
"email",
"user_birthday",
"user_friends",
"user_about_me",
"user_location"))
.flatMap(login -> facebook.getProfile())
.subscribe(profile -> {
System.out.println(profile.name());
System.out.println(profile.email());
System.out.println(profile.birthday());
});
}); |
I've tested this example using v4 version and I'm not obtaining any print so I've changed to this code:
but it never prints the result of I forced an error like removing the facebook activity from manifest and it prints the result of I get this on the log but nothing more:
Any ideia? Thanks in advance. |
Hi @ejbp, Do you override public class XXXActivity extends Activity {
// ..
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
facebook.onActivityResult(requestCode, resultCode, data);
}
} I think I forgot to write it on README, sorry. |
Yes. That was the issue but now I'm facing two issues: ---- UPDATE ------ When I run the app with this code (if I'm not logged):
The log result after I click the button is:
Meaning that the callbacks of subscription are never called. 2.
It means that it doesn't give me the email value, having in mind that in the authorisation facebook window I gave access to public profile and email. After digging in your code, specifically in the
Though, this is not the point of your lib that intents to abstract this. Conclusion
|
Sorry for the newbie question, but I'm new to Facebook Graph API and even greener when it comes to RetroFacebook. I'm using Facebook SDK with the provided Login Button, setting the needed read permissions, and just after login I'm issuing a newMeRequest() call to get extra data for the user. I'm stuck converting my code to use RetroFacebook. How could I convert the following code to use RetroFacebook?
I've included my pointless attempt at using facebook.me()... Just for reference...
I'm setting up the permissions on the FacebookLoginButton like this, and the code works:
The text was updated successfully, but these errors were encountered: