Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

com.inthecheesefactory.thecheeselibrary:fb-like

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.inthecheesefactory.thecheeselibrary:fb-like

A wrapper for Facebook Native Like Button (LikeView) on Android

  • 0.9.3
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

FBLikeAndroid

A wrapper for Facebook Native Like Button (LikeView) on Android

Version

1.0.1

Installation

To use this library in your android project, just simply add the following dependency into your build.gradle

dependencies {
    compile 'com.inthecheesefactory.thecheeselibrary:fb-like:1.0.1'
}

Usage

Full document is available at http://inthecheesefactory.com/blog/how-to-add-facebook-like-button-in-android-app/en

First of all, you have to setup the create a Facebook App and setup Facebook SDK for Android in your Android App. Please check this link.

After that, place com.inthecheesefactory.lib.fblike.widget.FBLikeView wherever you want to place a Facebook Like Button, for example:

<TextView
    android:id="@+id/tvUrl"
    android:text="@string/hello_world" android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<com.inthecheesefactory.lib.fblike.widget.FBLikeView
    android:id="@+id/fbLikeView"
    androi:text="Login to Like"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

You could get a LikeView instance through getLikeView method.

FBLikeView fbLikeView = (FBLikeView) rootView.findViewById(R.id.fbLikeView);
LikeView likeView = fbLikeView.getLikeView();

To set a url and its type, you could do via LikeView's setObjectIdAndType method.

fbLikeView.getLikeView().setObjectIdAndType("YOUR_URL_HERE", LikeView.ObjectType.OPEN_GRAPH);

And to connect every single FBLikeView to Facebook Login process, you have to add this line to every single Activity's onActivityResult in your app.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    FBLikeView.onActivityResult(requestCode, resultCode, data);
}

That's all. LikeView will now work perfectly in your app !

To disconnect your app from Facebook, just simply use this command:

FBLikeView.logout();

Change Logs

v1.0.1

Fix minor bug

v1.0.0

Update Facebook SDK version to v4.4.0

v0.9.3

Initial version

License

Apache 2.0

FAQs

Package last updated on 25 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc