1

所以我正在使用我作为 maven 依赖项包含的最新版本的 FB SDK: compile 'com.facebook.android:facebook-android-sdk:3.20.0'

我正在尝试发送应用请求,但它只为我推荐了 6 个朋友。有没有办法让它建议更多,比如250?

这是我用来发送请求的代码:

public static void openDialogInvite(final Activity activity)
{
    Bundle params = new Bundle();
    params.putString("message", "Join our app");

    Settings.setPlatformCompatibilityEnabled(true);

    WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(activity,
            Session.getActiveSession(), params))
            .setOnCompleteListener(new WebDialog.OnCompleteListener()
            {
                @Override
                public void onComplete(Bundle bundle, FacebookException error)
                {
                    if (error != null)
                    {
                        if (error instanceof FacebookOperationCanceledException ||
                                error instanceof FacebookServiceException)
                        {
                            Logger.d("Request canceled");
                        }
                        else
                        {
                            Logger.d("Network error");
                        }
                    }
                    else
                    {
                        final String requestId = bundle.getString("request");
                        if (requestId != null)
                        {
                            //kv Get fb ids of invited friends
                            //kv These are not in a string array as you might expect
                            //kv They are of the form:
                            //kv to[0]=id1, to[1]=id2, ...
                            ArrayList<String> to = new ArrayList<String>();
                            for (String key : bundle.keySet())
                            {
                                if (key.contains("to"))
                                {
                                    to.add(bundle.getString(key));
                                }
                            }
                        }
                    }
                }
            })
            .build();

    //kv Only show the Dialog if the Activity isn't finishing up, or else it could crash (BadTokenException)
    if (!activity.isFinishing())
    {
        requestsDialog.show();
    }
}
4

1 回答 1

2

API 中没有指定您希望显示更多推荐朋友的机制。也就是说,这个数字并不总是 6(尽管有些人可能只看到 6),而且我们一直在尝试新的用户体验。

如果他们想邀请特定的朋友,用户还可以使用搜索字段输入姓名。

于 2014-12-19T17:40:10.293 回答