Implement a Facebook Like Button in-game through Unity iOS

Does anyone know if it is possible to implement a Facebook login and ‘Like’ button within your iOS Unity developed App and keep track of whether the user already liked you?

I looked on the Asset Store through the various Facebook plugins, and none of them particularly mentioned whether this was possible or were vague, so I was wondering if anyone had experience implementing this or using any of the plugins, and what I should expect from them.

The plugins I looked over were:

iOS Social Networking Plugin by Prime31

Easy Facebook Integration by Studio Evil

Facebook Menu System by iffcom.ch

FB2Unity by Methodized

Thank you.

Hi, did you ever get this to work? I’ve go to do the same thing now and I’d love some advice on which library to use.

+1 here

I looked around and to do a Like Button in an iOS app the only way is use a dirty objective-c hack mentioned as the first answer here:

http://stackoverflow.com/questions/2783803/adding-the-facebook-like-button-in-an-iphone-app

The problem is the Facebook API does not allow Like a page buttons, so you have to open a webpage view on iOS then direct the users to a link.

None of the plugins do this unfortunately.

The easiest way I’ve found is to try and open the fb app to your page. If it doesn’t open then open your page using the browser. I wish there was a way to do it without leaving the app. Oh well.

Application.OpenURL(“fb://profile/#############”);//replace the #'s with your profile id
Application.OpenURL(“Redirecting...”);

SOOMLA has all the features you’re looking for implemented for Facebook, as well as Twitter and Google+. The plugin is called SOOMLA Profile and is free on the asset store:

Specifically for the things you requested, the APIs are:

  • Login: SoomlaProfile.Login(Provider.FACEBOOK, null, coinsReward);
  • Like: SoomlaProfile.Like(Provider.FACEBOOK, “your.facebook.page”);

Keeping track of whether a user liked you or not is not possible, the Facebook API limits this and requires the user to actually enter the web page.

For full disclosure, I’m one of the founders. Feel free to reach me directly on Twitter.

1 Like