iOS 'like' facebook application page, how to do it? [duplicate]
Asked Answered
C

2

6

Possible Duplicate:
Like button in iOS application

I'm trying to make it easier for a user of my App to 'Like' my facebook application.

The scenario is, the user has already logged in and authorised my application, so I have the user's oauth token. Since the Graph API does not allow this, I've tried multiple other ways, all unsuccessfully.

Methods: 1) Have it navigate to the facebook application's facebook page in a UIWebView 2) Make my App launch the Facebook App unto my facebook application's page.

In method 1, the main issue is the user will in many cases have to login in the webview again, because I've not found a way to somehow pass the token to the webview session. In the Foursquare api for example, all you need to do is to append the token to the url as a query string, (http://foursquare.com/blabla?access_token=52521....), this doesnt work in facebook.

In method 2, which can be accomplished using this method:

NSString *fbAppUrl = [NSString stringWithFormat:@"fb://applications/%@",[App facebookAppId]];
BOOL didOpenOtherApp = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fbAppUrl]];

No matter what I try, i.e. fb://applications/%@ or fb://pages/%@ or fb://profile/%@ or fb://feed/%@, the facebook app just opens to a blank page.

Any hints or tips from anyone?

I would love to be able to make use of method 2 and fall back to method 1 if the facebook app is not installed, but in essence, method 1 will result in a very low conversion rate, so hoping to avoid it.

Colostrum answered 11/4, 2011 at 10:43 Comment(1)
Just in case anyone comes across this whilst searching for a solution. Facebook has just released support for native mobile like functionality. developers.facebook.com/blog/post/2012/06/20/…Colostrum
L
4

Facebook iPhone app doesn't currently support that, nor does the graph api. The only way supported by Facebook to "like" a url is from their iFrame code. There is a halfway decent blog post on how to do a variation of option #1 but looks to see if they are logged into Facebook via Safari. Not the best user experience, but all that Facebook allows at the moment.

Longoria answered 23/5, 2011 at 1:26 Comment(3)
Thx bkaid, yeah this is in principle the same as my method 1. I'm still looking for a way around it, surely there must be a way?Colostrum
Not officially at the moment. It would be too easy for scammers to abuse otherwise. I'll update the answer if they add an option. The only other way would be to store the user's login information and do an http post to the url that the facebook.com website uses but that is obviously scraping and a violation of their terms of service.Longoria
Anyways, cheers for that, I'll update this answer too if I come across anything, but I'm sure you will do that before me ;DColostrum
E
0

It seems there is an agreement on not being able to do this. However, this post shows you can: Using 'Like' with the Facebook Graph API on iOS

To back it up, here's an excerpt from FB Graph API documentation:

You can comment on or like any object that has a /comments or /likes connection by posting to https://graph.facebook.com/OBJECT_ID/comments and https://graph.facebook.com/OBJECT_ID/likes, respectively:

(source: http://developers.facebook.com/docs/reference/api/)

Eximious answered 2/12, 2011 at 6:23 Comment(2)
terribly sorry, this post explains that you can like pretty much everything, except for pages on facebook: #5837510Eximious
Be careful when posting copy and paste boilerplate/verbatim answers to multiple questions, these tend to be flagged as "spammy" by the community. If you're doing this then it usually means the questions are duplicates so flag them as such instead.Keeton

© 2022 - 2024 — McMap. All rights reserved.