Android - Facebook SDK的ShareButton提示在从WebDialogs

时间:2016-01-22 06:08:58

标签: android facebook facebook-graph-api

我已在我的应用程序中成功实施了Facebook SDK的ShareButton。当我安装了正式的Facebook应用程序时,ShareButton可以正常工作。但是当我没有官方应用时,ShareButton会打开WebDialog

我的问题:
每当我使用WebDialog分享任何帖子时,它会提示打开浏览器。帖子已成功共享,但WebDialog仍提示打开浏览器。

截图:

1)这是WebDialog

This is the Webdialog

2)这是我在分享职位后得到的。
enter image description here



代码:

public class FragmentDetails extends Fragment
{
    ShareButton facebookShareButton;
    CallbackManager callbackManager;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        View view = inflater.inflate(R.layout.fragment_details, container, false);
        facebookShareButton = (ShareButton) view.findViewById(R.id.fragmentDetails_FacebookShare);
        ShareLinkContent content = new ShareLinkContent.Builder()
            .setContentUrl(Uri.parse("https://developers.facebook.com"))
            .build();
        facebookShareButton.setShareContent(content);


        return view;
    }
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        FacebookSdk.sdkInitialize(getContext());
        callbackManager = CallbackManager.Factory.create();
    }
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data)
    {
        super.onActivityResult(requestCode, resultCode, data);
        callbackManager.onActivityResult(requestCode, resultCode, data);
    }
}

0 个答案:

没有答案