所以我正在使用我作为 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();
}
}