2017-09-25 63 views
0

我在我的iOS項目中使用登錄Twitter。我已經完成了所有需要設置的事情。但我不能得到user_email。我已經在twitter App上檢查了「請求電子郵件給用戶」。但仍然有錯誤。Twitter user_email請求

這裏的錯誤信息

Request failed: unauthorized (401) 

而且繼承人可以編碼

TWTRAPIClient *client = [TWTRAPIClient clientWithCurrentUser]; 
      [client requestEmailForCurrentUser:^(NSString *email, NSError *error) { 
       if (email) { 
        NSLog(@"signed in as %@", email); 
       } else { 
        NSLog(@"error: %@", [error localizedDescription]); 
       } 

      }]; 

我希望你能幫助我在此。謝謝!

+1

檢查您的授權密鑰和祕密。他們有什麼問題.. –

回答

0

我有同樣的問題。 TWTRAPIClient在會話存儲中有兩個TWTRSession。重新安裝應用。這將解決問題。