0

I'm developing an iPhone application using the Facebook Connect API. I arrived to set the "Like" on a post using the following code:

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/likes", discussion.postId]];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setPostValue:[self.facebook accessToken] forKey:@"access_token"];
[request setDelegate:self];
[request startAsynchronous];

It generates the following call:

HTTP POST https://graph.facebook.com/147512198609691_148877991806445/likes

But I'm not able to do the inverse operation "Unlike" (removing the like from the post).

I tried the following:

HTTP POST https://graph.facebook.com/147512198609691_148877991806445/likes?access_token=....&method=delete

and also:

HTTP DELETE https://graph.facebook.com/147512198609691_148877991806445/likes?access_token=....

But those are not working, probably I'm using a wrong command.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
scriba
  • 97
  • 5

1 Answers1

0
[request setPostValue:@"DELETE" forKey:@"method"];
Luke
  • 11,426
  • 43
  • 60
  • 69
BloopDev
  • 31
  • 2
  • 4