2014-12-17 6 views
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(); 
    } 
} 

답변

2

없습니다 :

는 여기에 내가 요청을 보낼 사용하고 코드입니다. 즉, 숫자는 항상 6이 아니지만 (일부 사용자는 6 만 표시 할 수 있음) 항상 새로운 사용자 경험을 실험하고 있습니다.

사용자는 특정 친구를 초대하려는 경우 검색 필드를 사용하여 이름을 입력 할 수도 있습니다.

+0

Ming에 감사드립니다. –