title: How to request publish permissions using Facebook's Android SDK?
body: <p>Without using any UI/Button, how to ask for publish permissions for Facebook app using Facebook's Android SDK? I'm currently using this code but it registers the callback twice giving me duplicate results. What is the correct way to ask for publish permissions?</p>
  
  <pre><code>    List&lt;String&gt; basicPermissions = Arrays.asList("user_friends", "user_games_activity");
      List&lt;String&gt; publishPermissions = Arrays.asList("publish_actions");
  
      mCallbackManager = CallbackManager.Factory.create();
      LoginManager.getInstance().logInWithReadPermissions(this, basicPermissions);
      LoginManager.getInstance().logInWithPublishPermissions(this, publishPermissions);
  
      LoginManager.getInstance().registerCallback(mCallbackManager,
              new FacebookCallback&lt;LoginResult&gt;() {
                  @Override
                  public void onSuccess(LoginResult loginResults) {
  
                      new GraphRequest(
                              AccessToken.getCurrentAccessToken(),
                              "/{my-app-id}/scores",
                              null,
                              HttpMethod.GET,
                              new GraphRequest.Callback() {
                                  public void onCompleted(GraphResponse response) {
                                      // my code
                                  }
                              }
                      ).executeAsync();
  
                  }
  
                  @Override
                  public void onCancel() {
  
                      Log.e("dd","facebook login canceled");
  
                  }
  
                  @Override
                  public void onError(FacebookException e) {
  
  
  
                      Log.e("dd", "facebook login failed error");
  
                  }
              });
  </code></pre>