Reputation: 584
I would like to retrieve the user Check-In or post with location info from face book in iOS (Objective C).
This is the sample code, I have tried and I did not get any success on this.
Could please review this and share some ideas to proceed further on this.
Note : I am trying to use GraphAPI.
Code:
[FBRequestConnection startWithGraphPath:@"me/feed" parameters:@{@"place":@"fbuser-id"} HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
//verify result
if(error) {
NSLog(@"Error publishing story.");
}
else {
NSLog(@"Story published.");
}
}];
Upvotes: 1
Views: 214
Reputation: 1704
can you try this...from this code you got location of you check-in
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/me/feed"
parameters:@{ @"fields": @"place",@"limit": @"200",}
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
NSLog(%@,result);
}];
if you don't have 'user_posts' permission..then fb not provide any data.
Upvotes: 1