1
그래서 저는 최신 버전의 FB SDK를 사용하여 메이븐 종속성으로 포함 시켰습니다 : com.facebook.android:facebook-android-sdk : 3.20.0 '페이스 북에서 친구들의 수를 늘리는 방법 Android App Request Dialog
앱 요청을 보내려고하지만 나에게 6 명의 친구 만 제안합니다. 250과 같이 더 많이 제안 할 수있는 방법이 있습니까? 당신이 더 많은 제안 친구를 표시하고 싶은 것을 지정하는 API의 메커니즘이
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();
}
}
Ming에 감사드립니다. –