Like button in iOS application
Asked Answered
R

5

22

Does anybody know how to place Facebook "like" button into iOS application? I've tried the method described in this blog post. But I do not really like this method, because its ugly Login dialog. And, what is more important, it makes user login twice. For example, user wants post a message to his wall if he isn't logged in I call standard FBLoginDialog, after that user posted a message he may want push "like" button and he have to login again - it is really bad user experience.

How to be? How can I give user "like" feature in my iOS app?

Razorbill answered 3/11, 2010 at 13:48 Comment(3)
Ditto, FBConnect is one of my reasons to delete an app (yes, really, it's that ugly…).Macassar
Take a look at FacebookLikeView: github.com/brow/FacebookLikeViewKania
It looks like Facebook finally decided to allow this more directly, via Open Graph. See documentation herePublicist
C
7

That is actually the only way to do it. There is no special iOS like button. However, the good news is that just today Facebook announced single sign in support for mobile apps. This should remove some of the burden the user faces to log in to facebook.

Cr answered 4/11, 2010 at 4:5 Comment(2)
Thank you for this information. But I do not understand how "single sign in" can help with "like" button. I really confused why Facebook API does not provide API for fully support of social plugins (like button, share button)Razorbill
I am saying that the single sign on will help with the use having to authenticate to facebook multiple times. Facebook does not provide a like API because they do not want spam applications to be able to force people to like things. I would think that eventually Facebook would make a iOS like button, but for now the web version is the only allowed solution.Cr
H
5

It seems there is an agreement on not being able to do this. This question shows you can, as does the 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.

Unfortunately, according to this question you can’t like a page.

Haggle answered 2/12, 2011 at 6:24 Comment(2)
terribly sorry, this post explains that you can like pretty much everything, except for pages on facebook: #5837510Haggle
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.Sacerdotalism
S
1

I like using ShareKit: http://www.getsharekit.com/

It's not exactly what you're looking for, but still...

Search answered 9/11, 2010 at 9:46 Comment(0)
S
1

The only way supported by Facebook on any platform (web, mobile, etc) is from their iFrame code. From iOS, that means embedding a UIWebView into your application with the iFrame code. Note that it does require them to login via Safari.

Solidary answered 2/12, 2011 at 15:9 Comment(0)
I
0
- (void)addLikeButton{
[FBSettings enableBetaFeature:TRUE];
[FBSettings enablePlatformCompatibility:NO];
 _like = [[FBLikeControl alloc] init];
_like.frame = CGRectMake(60,12,200,33);
_like.likeControlAuxiliaryPosition = FBLikeControlAuxiliaryPositionInline;
_like.likeControlHorizontalAlignment = FBLikeControlHorizontalAlignmentLeft;
_like.objectID = @"https://www.facebook.com/pages/Strana-Gapra/1377227779244834";
_like.likeControlStyle = FBLikeControlStyleStandard ;
[_like addTarget:self action:@selector(onSelect:) forControlEvents:UIControlEventValueChanged];
[self.likeView addSubview:_like];
[self performSelector:@selector(getLikeSubviews) withObject:nil afterDelay:0.6];

}

Indefeasible answered 22/6, 2015 at 14:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.