1
如何獲取詳細信息,如個人資料圖片和更多的信息,而Twitter登錄IOS使用Fabric。 我寫這篇文章的代碼 -獲取詳細信息像個人資料圖片和更多信息,而IOS登錄IOS 10.2使用結構
[[Twitter sharedInstance] logInWithCompletion:^
(TWTRSession *session, NSError *error) {
if (session) {
/* Get user info */
[[[Twitter sharedInstance] APIClient] loadUserWithID:[session userID]
completion:^(TWTRUser *user,
NSError *error)
{
// handle the response or error
if (![error isEqual:nil]) {
NSLog(@"Twitter info -> user = %@ ",user);
NSString *urlString = [[NSString alloc]initWithString:user.profileImageLargeURL];
NSURL *url = [[NSURL alloc]initWithString:urlString];
NSData *pullTwitterPP = [[NSData alloc]initWithContentsOfURL:url];
UIImage *profImage = [UIImage imageWithData:pullTwitterPP];
} else {
NSLog(@"Twitter error getting profile : %@", [error localizedDescription]);
}
}];
} else {
NSLog(@"error: %@", [error localizedDescription]);
}
}];
完美的作品,謝謝! – Tim
蒂姆你最歡迎! –