I want to share my game score on facebook. I checked lots of links and every post people are saying that POSTING on facebook using INTENT i
Just try the below snippet,
call wherever you want like below
ShareDialog shareDialog;
FacebookSdk.sdkInitialize(mContext);
shareDialog = new ShareDialog(mContext);
shareScoreonFB("345"); // just pass your score here in string format. call this inside click listener.
// GLOBAL FUNCTION TO SHARE SCORE ON FB
void shareScoreonFB(String score)
{
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setContentTitle("Your score is : "+score)
.setContentDescription("Any description that you needed")
.setContentUrl(Uri.parse("https://play.google.com/store/apps/details?id=com.mobtraffiq.numbertap&hl=en")).build();
shareDialog.show(linkContent);
}
NOTE: Make sure you initialize the Facebook SDK.
Hope this helps you, let me know for queries.