code: private boolean startPublishPermissionsRequest(Activity activity, Fragment fragment) {
          boolean isSuccessful = false;
  
          // State transition.
          mLinkRequestState = STATE_PUBLISH_PERMISSIONS_REQUEST;
  
          Session session = Session.getActiveSession();
          if (session != null && session.isOpened()) {
              // Construct publish permissions.
              List<String> publishPermissions = new LinkedList<String>();
              publishPermissions.add(PERMISSION_PUBLISH_ACTIONS);
              publishPermissions.add(PERMISSION_MANAGE_PAGES);
  
              // Construct permissions request to publish publicly.
              NewPermissionsRequest permissionsRequest;
              if (fragment == null) {
                  permissionsRequest = new NewPermissionsRequest(activity, publishPermissions);
              } else {
                  if (fragment.getActivity() == null) {
                      return false;
                  }
                  permissionsRequest = new NewPermissionsRequest(fragment, publishPermissions);
              }
              permissionsRequest.setDefaultAudience(SessionDefaultAudience.EVERYONE);
  
              // Execute publish permissions request.
              session.requestNewPublishPermissions(permissionsRequest);
              isSuccessful = true;
          }
          return isSuccessful;
      }
docs: Requests for permissions to publish publicly. Requires an opened active {@link Session}.
  
  @param activity the {@link Activity}.
  @param fragment the {@link Fragment}. May be null.
  @return true if the request is made; false if no opened {@link Session} is active.