[英]Birthday scope not showing in facebook login permission dialog
I am using xamarin.forms PCL Project having two project android and IOS我正在使用 xamarin.forms PCL 项目有两个项目 android 和 IOS
I have integrated facebook in my project.我已经在我的项目中集成了 facebook。 I pass three permission
public_profile
, email
, user_birthday
in facebook sdk.我在 facebook sdk 中通过了三个权限
public_profile
、 email
、 user_birthday
。 when I try to login through facebook, Facebook permission dialog page open but it ask to accept only two permission email
, public_profile
, It not ask user_birthday
permission当我尝试通过 facebook 登录时,Facebook 权限对话框页面打开但它只要求接受两个权限
email
, public_profile
,它不要求user_birthday
权限
Following is my code:以下是我的代码:
public class FacebookLoginButtonRenderer : ButtonRenderer,IFacebook
{
private static Activity _activity;
protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
{
base.OnElementChanged(e);
_activity = this.Context as Activity;
if (this.Control != null)
{
Android.Widget.Button button = this.Control;
button.SetOnClickListener(ButtonClickListener.Instance.Value);
}
}
void IFacebook.Logout()
{
LoginManager.Instance.LogOut();
}
private class ButtonClickListener : Object, IOnClickListener
{
public static readonly Lazy<ButtonClickListener> Instance = new Lazy<ButtonClickListener>(() => new ButtonClickListener());
public void OnClick(View v)
{
LoginManager.Instance.LogInWithReadPermissions(_activity, new List<string> { "public_profile","email","user_birthday"});
}
}
}
FacebookClient fb = new FacebookClient(AccessToken);
fb.GetTaskAsync("me?fields=id,email,first_name,last_name,gender,birthday").ContinueWith(t =>
{
if (!t.IsFaulted)
{
var obj = (IDictionary<string, object>)t.Result;
}
});
In login permission dialog not asking for birthday as shown in below image在登录权限对话框中不要求生日,如下图所示
Please suggest how to solve this请建议如何解决这个问题
Thanks in advance提前致谢
Since v2.0 of the Graph API, it´s not possible to get friend birthdays anymore.从 Graph API 的 v2.0 开始,不可能再获得朋友的生日了。 You can only get the birthday of the authorized user by using the user_birthday permission.
您只能通过 user_birthday 权限获取授权用户的生日。 See the changelog for more information: https://developers.facebook.com/docs/apps/changelog
有关更多信息,请参阅变更日志: https : //developers.facebook.com/docs/apps/changelog
There is only one other possibility: If the friend authorized the App with user_birthday, you can get his birthday with the following call: /friend-id?fields=birthday只有另一种可能:如果好友使用 user_birthday 授权应用程序,您可以通过以下调用获取他的生日:/friend-id?fields=birthday
Of course you need to authorize users with user_friends too, in order to make this work.当然,您也需要使用 user_friends 来授权用户,以便完成这项工作。 And you can also just store the birthday of all authorized users and don´t waste an extra API call on it.
而且您还可以只存储所有授权用户的生日,而不会浪费额外的 API 调用。 Check This :
检查这个:
How to get friend's birthday list using facebook api? 如何使用facebook api获取朋友的生日列表?
更改 user_birthday 的生日和 user_gender 的性别,然后按照https://developers.facebook.com/docs/facebook-login/review上的说明提交应用程序以查看权限
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.