admin管理员组文章数量:1327835
I have the following function (taken from the facebook webhook tutorial) for subscribing an app to a page, but I want the reverse thing to happen ( unsubscribe).
How can I do that? I have not found any answers yet, in JavaScript.
function subscribeApp(page_id, page_access_token) {
console.log('Subscribing page to app! ' + page_id);
FB.api(
'/' + page_id + '/subscribed_apps',
'post',
{access_token: page_access_token},
function(response) {
console.log('Successfully subscribed page', response);
// insert in DB
});
}
I have the following function (taken from the facebook webhook tutorial) for subscribing an app to a page, but I want the reverse thing to happen ( unsubscribe).
How can I do that? I have not found any answers yet, in JavaScript.
function subscribeApp(page_id, page_access_token) {
console.log('Subscribing page to app! ' + page_id);
FB.api(
'/' + page_id + '/subscribed_apps',
'post',
{access_token: page_access_token},
function(response) {
console.log('Successfully subscribed page', response);
// insert in DB
});
}
Share
Improve this question
asked Apr 6, 2016 at 7:03
Alex BesleagaAlex Besleaga
611 silver badge5 bronze badges
1
- 1 I think I have found my answer : function unsubscribeApp(page_id, page_access_token) { console.log('Unsubscribing... ! ' + page_id); FB.api( '/' + page_id + '/subscribed_apps', 'DELETE', {access_token: page_access_token}, function(response) { console.log('Successfully unsubscribed page', response); // insert in DB }); } – Alex Besleaga Commented Apr 6, 2016 at 8:10
1 Answer
Reset to default 8Here ya go.
function unSubscribeApp(page_id, page_access_token) {
console.log('Unsubscribing app from page! ' + page_id);
FB.api(
'/' + page_id + '/subscribed_apps',
'delete',
{access_token: page_access_token},
function(response) {
console.log('Successfully unsubscribed page', response);
}
);
}
本文标签: javascriptHow to unsubscribe an app from a page for facebook webhook lead adStack Overflow
版权声明:本文标题:javascript - How to unsubscribe an app from a page for facebook webhook lead ad? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742219585a2435200.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论