2012-06-27 30 views
0

我在我的範圍中有電子郵件,我看到該應用程序具有給定的電子郵件權限,但結果中沒有電子郵件,但是如果我使用具有應用程序訪問令牌的資源管理器,我收到了電子郵件。 這讓我瘋狂我相信我的一切都正確。在圖表結果中沒有電子郵件,但在圖形API資源管理器中顯示

Return Redirect(String.Format("https://www.facebook.com/dialog/oauth?client_id={0}&scope=email&redirect_uri={1}&state={2}", My.Resources.FacebookApiKey, My.Resources.FacebookRedirectUrl, Session.SessionID)) 


Dim webRequest As System.Net.HttpWebRequest 
     Dim targetURI As New Uri(String.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&client_secret={2}&code={3}&scope=email", My.Resources.FacebookApiKey, My.Resources.FacebookRedirectUrl, My.Resources.FacebookApiSecret, code)) 
     webRequest = DirectCast(System.Net.HttpWebRequest.Create(targetURI), System.Net.HttpWebRequest) 
     If (webRequest.GetResponse().ContentLength > 0) Then 
      Dim str As New System.IO.StreamReader(webRequest.GetResponse().GetResponseStream()) 
      reply = str.ReadToEnd 
      str.Close() 
     End If 

     Dim replies As String() = Split(reply, "=") 
     targetURI = New Uri(String.Format("https://graph.facebook.com/me?access_token={0}", replies(1))) 
     webRequest = DirectCast(System.Net.HttpWebRequest.Create(targetURI), System.Net.HttpWebRequest) 
     If (webRequest.GetResponse().ContentLength > 0) Then 
      Dim str As New System.IO.StreamReader(webRequest.GetResponse().GetResponseStream()) 
      reply = str.ReadToEnd 
      str.Close() 
     End If 

如果你能照一些輕我將是最幸福的。

+0

你可能想訂閱這個錯誤報告https://developers.facebook.com/bugs/428191153870147 – Oklahomer

回答

0

我不是.NET程序員,但如果電子郵件是缺少的唯一的事情,你可以嘗試添加查詢字符串的URL請求,就像這樣:

https://graph.facebook.com/me?access_token={0}&fields=email 

應該做工精細在一個JSON對象返回的電子郵件地址:

{ 
    "email": "[email protected]", 
    "id": "12312312312313123123", 
    "type": "user" 
} 
相關問題