我正在嘗試使用適用於iOS的新面料twitter套件。 登錄後,我們可以要求用戶允許訪問電子郵件ID,如果允許,然後返回登錄用戶的電子郵件,但它給我錯誤。無法使用twitter結構從twitter獲取用戶的電子郵件iOS框架
Email (null), Error: Error Domain=NSURLErrorDomain Code=-1001
"The request timed out." UserInfo=0x7fdd314f1c30
{NSUnderlyingError=0x7fdd314d9aa0 "The request timed out.",
NSErrorFailingURLStringKey=https://api.twitter.com/1.1/account/verify_cre
dentials.json?skip_status=true&include_email=true,
NSErrorFailingURLKey=https://api.twitter.com/1.1/account/verify_credentia
ls.json?skip_status=true&include_email=true,
NSLocalizedDescription=The request timed out.}
而這裏是我的代碼,我試圖從他們的文檔。
if ([[Twitter sharedInstance] session]) {
TWTRShareEmailViewController* shareEmailViewController =
[[TWTRShareEmailViewController alloc]
initWithCompletion:^(NSString* email, NSError* error) {
NSLog(@"Email %@, Error: %@", email, error);
}];
[self presentViewController:shareEmailViewController
animated:YES
completion:nil];
} else {
// TODO: Handle user not signed in (e.g.
// attempt to log in or show an alert)
}
我的代碼有什麼問題嗎?請幫幫我。 我可以將我的狀態和媒體發佈到Twitter,但無法獲取電子郵件ID。
任何人都可以請幫我解決這個問題嗎?我也是新來的發展。
你的應用程序是否被推特列入白名單 –
我不明白,他們是什麼意思,白名單,我不這麼認爲。 – Nij
結帳This post http://stackoverflow.com/a/30477261/4395879 –