0
我試圖在Facebook重新要求拒絕的權限。重新申請Xamarin.Auth的facebook權限
根據facebook開發者的說法,一旦有人拒絕了權限,登錄對話框將不會重新詢問他們,除非您明確告訴對話框,您重新要求拒絕的權限。
您可以通過將auth_type=rerequest
參數添加到您的登錄中。
我做了這個,但是這麼想的工作
var auth = new OAuth2Authenticator(
clientId: "my app id", // your OAuth2 client id
scope: "email", // the scopes for the particular API you're accessing, delimited by "+" symbols
authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"),
redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html"));
progressDialog.Show();
auth.Completed += async (sender, eventArgs) =>
{
if (eventArgs.IsAuthenticated)
{
var accessToken = eventArgs.Account.Properties["access_token"].ToString();
var expiresIn = Convert.ToDouble(eventArgs.Account.Properties["expires_in"]);
var expiryDate = DateTime.Now + TimeSpan.FromSeconds(expiresIn);
IDictionary<string, string> hashRequest = new Dictionary<string, string>();
hashRequest.Add("auth_type", "rerequest");
var request = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me?fields=education,email,location,name"),hashRequest, eventArgs.Account);
var response = await request.GetResponseAsync();
var obj = JObject.Parse(response.GetResponseText()); ...