Along with the "post", and you will also need a "place" ID to publish as a parameter.
Request "publish_actions" so you can publish the place / location.
Below is the code I used:
NSMutableDictionary *params = [NSMutableDictionary dictionary]; [params setObject:@"Hello World" forKey:@"message"]; [params setObject:@"110503255682430" forKey:@"place"]; [[[FBSDKGraphRequest alloc] initWithGraphPath:@"/me/feed" parameters:params HTTPMethod:@"POST"] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { NSLog(@"result %@",result); NSLog(@"error %@",error); }];
You can also verify this using the Administrator / Tester accounts listed on the Developer page → your application → Roles. Use Graph explorer for best practice: https://developers.facebook.com/tools/explorer/108895529478793?method=POST&path=me%2Ffeed%3F&version=v2.5&message=Hello%20world&place=110503255682430
The code below can help you find the ID of a place near your location:
NSMutableDictionary *params2 = [NSMutableDictionary dictionaryWithCapacity:4L]; [params2 setObject:[NSString stringWithFormat:@"%@,%@",YourLocation latitude,YourLocation longitude] forKey:@"center"]; //Hard code coordinates for test [params2 setObject:@"place" forKey:@"type"]; [params2 setObject:@"100"/*meters*/ forKey:@"distance"]; [[[FBSDKGraphRequest alloc] initWithGraphPath:@"/search" parameters:params2 HTTPMethod:@"GET"] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { NSLog(@"RESPONSE!!! /search"); }];
OR
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"/search?type=place¢er=YourLocationLat,YourLocationLong&distance=500" parameters:nil HTTPMethod:@"GET"] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { NSLog(@"result %@",result); }];
Hope this helps you.
source share