Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

integrate facebook with like button in android and iphone

I want to integrate facebook with like button in android and iphone. I integrated facebook in android and iphone also but i didn't integrate like button . So please tell me how to integrate the facebook like button in android and also in iphone.

For integrate the facebook i used below link example in android

https://github.com/facebook/facebook-android-sdk

Now i have to integrate the facebook like button.

Best Regards.

Thanks in advance.

like image 209
girish Avatar asked May 09 '11 09:05

girish


2 Answers

Check out this nice bit of code: http://angelolloqui.blogspot.com/2010/11/facebook-like-button-on-ios.html

Add the FBLikeButton class to your view:

FBLikeButton *likeButton = [[FBLikeButton alloc] initWithFrame:CGRectMake(0, 372, 320, 44)  
andUrl:@"http://www.facebook.com/pages/De-Zilk/108209735867960"];

Thanks a lot Angel García Olloqui

like image 86
Ben Groot Avatar answered Oct 20 '22 05:10

Ben Groot


There is no like button in facebook graph api. There are some alternatives that you can select. First you can use a webview and show the like button in a webview.

https://developers.facebook.com/docs/reference/plugins/like/

Another alternative is using facebook share functionality in facebook-android-sdk.

Last and more general alternative is using an intent and let the user select how to share it. (it can be any app including facebook)

Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "YOUR SUBJECT HERE!");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "YOUR TEXT HERE");
startActivity(Intent.createChooser(shareIntent, "YOUR TITLE HERE"));
like image 26
Yekmer Simsek Avatar answered Oct 20 '22 05:10

Yekmer Simsek