iosobjective-cfacebookfacebook-graph-apislrequest

Liking Facebook Page on behalf of user through SLRequest?


I'm currently using SLRequest to allow the user to like our app page in exchange for virtual currency / new character. What parameters do I need to set to allow this? I already have been granted public_actions permission.

I found the following, but I'm still confused on what to do exactly: https://developers.facebook.com/docs/opengraph/guides/og.likes


Solution

  • If you read this documentation, it says-

    The og.likes action can refer to any open graph object or URL, except for Facebook Pages or Photos.

    So, liking a page with Graph API isn't possible.

    I think you have just 2 alternatives-

    1. You can load the FB page in the FB application and make the user able to like the page from there.

      [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb://profile/{page-id}"]];
      
    2. You can use a UIWebView and add a Like Button.

    You can also check this: FacebookLikeView