Facebook Like button for one facebook page of an app from it's own ios app

后端 未结 2 1488
迷失自我
迷失自我 2021-01-07 08:47

I am looking for Like Button to be shown in my ios native app, users of that app have already connected to app via facebook account.

there are several questions rela

相关标签:
2条回答
  • 2021-01-07 09:13

    This still can't be done directly using the graph api ( to the best of my knowledge ). What you can do is open a webview to the page you want the user to like. If you're rewarding their liking your app or something, when they close the webview (you'll have to provide a close button), you can use the graph api to check whether they like your app page. As far as I can tell this is the best current solution - and seems to be the approach taken by mobile games.

    That said, I haven't used Facebook SDK 3 yet, so there may be something in there that could help you.

    0 讨论(0)
  • 2021-01-07 09:20

    It appears that Liking a page on behalf of a user is still impossible. I've glanced over the iOS SDK Reference, and it doesn't seem like there is a built in mechanism to like anything.

    However, in reading one of the other posts you linked to, and remembering that Facebook opened up the Like open graph action so app developers could allow their users to like content generated by their application...I found this link about built-in-actions (likes).

    According to that link, you can post Like actions to your users by POSTing to https://graph.facebook.com/<user_id>/og.likes with the POST params for object (the open graph object URL you want to like on behalf of the user in this case your page's url. eg. www.facebook.com/yourpage) and access_token (obviously, for your user).

    I'm not totally convinced that will work; though it is conceivable. My second thought would be to create an Open Graph Object for your page, and have all your users like that. Though, that is a little less ideal, as it removes the possibility of people finding your Page while they're on Facebook and would require you to put a lot more effort into getting likes for the Page via your website, application, etc.

    I hope that helps a bit, good luck.

    0 讨论(0)
提交回复
热议问题