【问题标题】:How to unsubscribe an app from a page for facebook webhook lead ad?如何从 facebook webhook 线索广告页面取消订阅应用程序?
【发布时间】:2016-07-26 10:06:54
【问题描述】:

我有以下函数(取自 facebook webhook 教程)用于将应用程序订阅到页面,但我希望相反的事情发生(取消订阅)。

我该怎么做?我还没有在 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
            });
    }

【问题讨论】:

  • 我想我找到了答案: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); // 插入数据库 }) ; }

标签: javascript facebook unsubscribe


【解决方案1】:

来吧。

  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);
      }
    );
  }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-13
    • 1970-01-01
    • 2017-04-14
    • 1970-01-01
    相关资源
    最近更新 更多