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