2

When user comments on a particular node the comment title and comment body should be automatically posted to my Facebook page. For this I have used Facebook autopost. I have added my appid in fb_autopost configuration page and it displays the list of pages I manage and I have selected required page. Used below rules for auto posting comment in facebook

{ "rules_facebook_autopost_" : {
    "LABEL" : "Facebook Autopost ",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "fb_autopost_entity", "comment" ],
    "ON" : { "comment_insert--comment_node_theme_display" : { "bundle" : "comment_node_theme_display" } },
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "facebook_publication",
            "param_type" : "link",
            "param_user" : [ "site:current-user" ]
          },
          "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
        }
      },
      { "data_set" : {
          "data" : [ "entity-created:field-facebook-message" ],
          "value" : "[comment:title]"
        }
      },
      { "publish_to_facebook" : {
          "USING" : { "publication" : [ "entity-created" ], "pages" : "1575855786569558" },
          "PROVIDE" : { "facebook_publication_id" : { "facebook_publication_id" : "Facebook publication returned ID" } }
        }
      },
      { "drupal_message" : { "message" : "success" } }
    ]
  }
}

After saving the comment it throws below error and comment not posting in Facebook.

Facebook SDK threw an error: OAuthException: (#200) The user hasn't authorized the application to perform this action

How can I achieve this or Is there any other way to do this. Thanks

2 Answers 2

3

Finally found the answer.

In admin/config/services/fbpermissions need to give Publish pages permission for users.enter image description here

0

I never used this module before, so i just found this.

Please follow this page instruction for configuration https://www.drupal.org/node/1914896

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.