2

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

KingPolygon
  • 4,753
  • 7
  • 43
  • 72

1 Answers1

2

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

Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
  • Would this require to reauthenticate the user through means other than ACAccountStore, or could I pull in the saved fbAccount that I stored, when asking for permission? – KingPolygon Apr 09 '14 at 07:35
  • When did I say you require any additional permissions/re-authentication ? :-/ – Sahil Mittal Apr 09 '14 at 07:37
  • I mean assuming I load up a webview with the page url, would the user have to sign in, or would it automatically authenticate them. – KingPolygon Apr 09 '14 at 07:38
  • To clarify What I was planning on doing was display a webview have the user like the app page, on dismissal perform a method that checks if user likes the page (using SLRequest) if so reward them. However, I would want to do this in the easiest possible manner. – KingPolygon Apr 09 '14 at 07:40
  • I think you can use the [FB.Event.subscribe](https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe) to catch the like/dislike event and handle the things accordingly. I've added a git project in the answer you can check – Sahil Mittal Apr 09 '14 at 07:59
  • thank you for your help, I'll definitely have a look! – KingPolygon Apr 09 '14 at 08:48
  • +1 for giving the deep-linking approach for fb:// However, it would be good to first make a check using UIApplication canOpenURL: API to check whether the user has facebook app open or not, and if not take an appropriate action of either opening in Native Browser using facebook.com instead of fb:// protocol or prompting the user for oAuth. – Nikita P Apr 05 '15 at 18:39