get usernameにはFacebook Graph APIを使用できます。 FBConnectパッケージのFBSession.mクラスにメソッドを追加します。
#import "JSON.h"
...........
static NSString *const kGraphAPIURL = @"https://graph.facebook.com/";
static NSString *const kFBGraphAPIUserName = @"name";
...........
// Get user name via Facebook GraphAPI.
- (NSString *)getUserNameByUID:(FBUID)aUID {
NSString *userName_ = nil;
NSURL *serviceUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%qi", kGraphAPIURL, aUID]];
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
NSError *error = nil;
NSString *jsonString = [NSString stringWithContentsOfURL:serviceUrl encoding:NSUTF8StringEncoding error:&error];
if (error != nil) {
NSLog(@"######### error: %@", error);
}
if (jsonString) {
// Parse the JSON into an Object and
// serialize its object to NSDictionary
NSDictionary *resultDic = [jsonString JSONValue];
if (resultDic) {
userName_ = [resultDic valueForKey:kFBGraphAPIUserName];
}
}
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
return userName_;
}
この質問は頼まれた:のhttp:/ /stackoverflow.com/questions/4772378/getting-user-id-of-facebook-and-twitter-in-sharekitまだ答えがありません*残念なことに* –