I'm trying to use a share button in my application, but it looks as if it was disabled:
I already initialize the sdk:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(getApplicationContext());
}
I also have the manifest correctly configured like the documentation suggest: https://developers.facebook.com/docs/android/getting-started
The button in the view is like this:
<com.facebook.share.widget.ShareButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/share"
android:id="@+id/share_on_fb_button"
bind:onClick="shareOnFBButtonClick"/>
What could be the problem? Why is the button disabled? Should I implement login functionality in my app? Or I only need to have facebook application on the device?
See com.facebook.share.widget.ShareButtonBase:
Calling setShareContent to enable the shareButton, try it:
Note: https://developers.facebook.com/docs/sharing/android
"When you implement sharing, your app should not pre-fill any content to be shared. This is inconsistent with Facebook Platform Policy, see Facebook Platform Policy, 2.3."