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

2

1

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 related to Facebook Like Button on stackoverflow but those are not specific to authorized single facebook page of the app.

According to official doc of facebook, facebook pages can not be liked via built-in action o open graph api.

But want only one official facebook page of that app to be liked by user when he hits like button. i don't want user to navigate away from the app or login again in web view to like facebook page.

is it possible to like app's facebook page without promoting user to log in again in webveiw?

Edit

Findings

1. https://mcmap.net/q/591671/-liking-a-page-on-behalf-of-a-user

2. Comment by wallacer

"the general consensus does seem to be that you can't like a page on behalf of the user, however I just had an ios game like a page on my behalf. Extreme Road Trip successfully manages to get you to like their own page. I wish I'd paid more attention when I did it now..." – wallacer

Epiphenomenalism answered 18/2, 2013 at 7:41 Comment(1)
If you find a good solution for this I'd be very interested :)Gammon
G
1

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.

Gammon answered 20/2, 2013 at 22:20 Comment(1)
Thanks for replying :) actually i've integrated Facebook SSO in my app, user has already logged in via facebook, let's suppose if user logs in through native Facebook app and he is not logged in on safari), then showing webview will require another login on webview. is there not any way to avoid explicit login in webview if user has already logged on facebook native ios app?Epiphenomenalism
U
0

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.

Untinged answered 18/2, 2013 at 13:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.