7

I've been trying to implement Facebook "Like" action in my app. Using the requestWithGraphPath:andParams:andHttpMethod:andDelegate: method I was able to like the posts, photos and almost everything but a Facebook Page. And the forums on the web say that this is due to some security reasons to prevent some spam apps from forcibly making the users "Like" their pages. It completely makes sense. So this raises a question that, making the users "Like" the posts or photos without the their knowledge is not an offense? And, yes, that is completely out of the scope of this question ;-)

Coming to the point, I've googled to see what's the most favorable solution and most of the forums/posts suggest that adding the "Like" button iFrame in a UIWebView is the better/only way as of now. So I just want to double check with you guys that is there a better way to Like a Facebook Page from an iOS app without having to use UIWebView lately, or I just have to go with that?

I'd really appreciate everyone!

EmptyStack
  • 51,274
  • 23
  • 147
  • 178
  • https://github.com/brow/FacebookLikeView - most of all can be done by this but if you want to make yourself like button then you need to make iframe for yr link from developer.facebook and later you need to detect Tap on webview using http://stackoverflow.com/questions/1049889/how-to-intercept-touches-events-on-a-mkmapview-or-uiwebview-objects and also need to check if user logged in or not.1 more thing to cancel loading on webview [webView stopLoading]; can be required later. – Dhaval Panchal Nov 29 '11 at 07:12
  • 1. http://stackoverflow.com/questions/2783803/adding-the-facebook-like-button-in-an-iphone-app 2. http://stackoverflow.com/questions/3809652/using-facebook-ios-sdk-2-how-do-i-like-a-page-application-must-be-on-whitel...i think these links will help you to understand more on this. – Saranya Nov 29 '11 at 11:35
  • @Saranya, dh14-sl, Is there any way other than using the iFrame? – EmptyStack Nov 30 '11 at 04:24
  • https://github.com/brow/FacebookLikeView download zip from this link. change appid with your created app's appid and change href put your like page link just all done. Even you can customize it.Read Getting started - it's easy to implement. – Dhaval Panchal Nov 30 '11 at 09:08

2 Answers2

2

I googled for this a lot. We have two ways for adding "Like" button from our app.

  1. By using iframe
  2. By adding HTML button

Here i have given some links for this. Hope this might help you.

a) http://petersteinberger.com/2010/06/add-facebook-like-button-with-facebook-connect-iphone-sdk/

b) http://angelolloqui.blogspot.com/2010/11/facebook-like-button-on-ios.html

c) Adding the Facebook Like Button in an iPhone App

Community
  • 1
  • 1
Saranya
  • 1,481
  • 3
  • 14
  • 26
1

You can use this it may solve your problem

https://github.com/brow/FacebookLikeView

  • Don't forget to read its [**caveats**](https://github.com/brow/FacebookLikeView#caveats) before implementing it to your project. – Hemang Apr 24 '13 at 12:07