Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Adding a Facebook Like button to a native iPhone app

I would like to know whether it is possible to add a Facebook Like button to a native iPhone app. In the app, the user browses a business directory or deals. When they tap on an item to view the details, it would be nice to have a Facebook Like button that can be used to post the item to the user's Facebook page.

Facebook writes: "Currently, the Like button is only available in mobile web apps".

My app is a native app and not a web app, so therefore I assume it's not possible. However, I do assume that it is possible to mix native UI components on a screen along with web components and therefore it might be possible to implement the Like button, although I am not sure how you pass data from the native portion to the web portion.

If the only solution is a hack, then I won't implement it because at some point the hack will fail when Facebook alters their API.

like image 640
Johann Avatar asked Nov 13 '11 08:11

Johann


People also ask

How do I add Facebook SDK framework to Xcode?

In Xcode, click File > Swift Packages > Add Package Dependency. In the dialog that appears, enter the repository URL: https://github.com/facebook/facebook-ios-sdk. In Version, select Up to Next Major and the default option. Complete the prompts to select the libraries you want to use in your project.

What iOS is needed for Facebook app?

Requires iOS 13.4 or later. Requires iPadOS 13.4 or later.

How do I log into Swift on Facebook?

First, go to developers.facebook.com and log in with your Facebook account. After you logged in, go to My Apps > Create App to create a new app. Give your app a name and a contact email address, and then press Create App ID. Press Set Up on Facebook Login.


1 Answers

read around SO a little, you get many leads. Here's one: Like button in iOS application

And a comment points to github.com/brow/FacebookLikeView

It has same caveats, but it seems there aren't any magic solutions.

There are these blogposts as well:

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

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

But not sure you get a native UIButton. Maybe you can open a webview in the background and emulate a click on it...

GL, update if you have some findings, Oded.

like image 96
Oded Ben Dov Avatar answered Oct 12 '22 23:10

Oded Ben Dov