Upload comments to particular post of facebook with object_id android

后端 未结 2 1069
南笙
南笙 2021-01-16 22:50

Hello friends I want to post comment to particular post in facebook with my android app, below is my code-

I Fetch All comments from URL which is below

2条回答
  •  失恋的感觉
    2021-01-16 23:23

    Using Graph API:

    ...
    if ([[FBSDKAccessToken currentAccessToken] hasGranted:@"publish_actions"]) {
        [[[FBSDKGraphRequest alloc]
          initWithGraphPath:@"post_id/likes"
          parameters: @{ @"like" : @"true"}
          HTTPMethod:@"POST"]
          startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
             if (!error) {
                 NSLog(@"It was liked.");
             }
         }];
    }
    ...
    

提交回复
热议问题