Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
com.inthecheesefactory.thecheeselibrary:fb-like
Advanced tools
A wrapper for Facebook Native Like Button (LikeView) on Android
A wrapper for Facebook Native Like Button (LikeView) on Android
1.0.1
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'
}
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();
Fix minor bug
Update Facebook SDK version to v4.4.0
Initial version
Apache 2.0
FAQs
A wrapper for Facebook Native Like Button (LikeView) on Android
We found that com.inthecheesefactory.thecheeselibrary:fb-like demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.