[FBRequestConnection startWithGraphPath:@"me"
parameters:@{
@"fields":@"id,birthday,name”, // 取得したいFieldを選択する
@"locale":@“ja_JP” // 言語選択
}
HTTPMethod:@“GET” // POSTだとエラーになる
completionHandler:
^(
FBRequestConnection *connection,
id result,
NSError *error
){
if (error) {
NSLog(@"Error: %@", error);
} else {
// 取得が成功したら、DictinaryのKEYにFieldの値を指定して取得する
NSDictionary* resultDict = (NSDictionary*)result;
NSString *name = resultDict[@"name”];
// 他で使えるように、プロパティに入れる
self.name = name;
NSLog(@"Result: %@", self.name);
}
}];
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme