diff --git a/docs/readme-facebook.md b/docs/readme-facebook.md index b6c75aea8..3c35cd0ae 100644 --- a/docs/readme-facebook.md +++ b/docs/readme-facebook.md @@ -474,8 +474,7 @@ controller.api.messenger_profile.get_account_linking(function (err, accountLinki controller.api.messenger_profile.delete_account_linking(); controller.api.messenger_profile.domain_whitelist('https://localhost'); controller.api.messenger_profile.domain_whitelist(['https://127.0.0.1', 'https://0.0.0.0']); -controller.api.messenger_profile.delete_domain_whitelist('https://localhost'); -controller.api.messenger_profile.delete_domain_whitelist(['https://127.0.0.1', 'https://0.0.0.0']); +controller.api.messenger_profile.delete_domain_whitelist(); controller.api.messenger_profile.get_domain_whitelist(function (err, data) { console.log('****** Whitelisted domains :', data); }); @@ -492,14 +491,19 @@ controller.api.messenger_profile.get_home_url(function (err, data) { controller.api.messenger_profile.delete_home_url(); -controller.hears(['hello'],'facebook_postback', function(bot, message) { - //... +// Target Audience +controller.api.messenger_profile.target_audience({ + "audience_type":"custom", + "countries":{ + "whitelist":["US", "CA"] + } }); - -controller.hears(['help'],'facebook_postback', function(bot, message) { - //... +controller.api.messenger_profile.delete_target_audience(); +controller.api.messenger_profile.get_target_audience(function (err, data) { + console.log('****** Target Audience :', data); }); + ``` diff --git a/lib/Facebook.js b/lib/Facebook.js index 7f47319ad..6dc540fed 100644 --- a/lib/Facebook.js +++ b/lib/Facebook.js @@ -493,6 +493,18 @@ function Facebookbot(configuration) { get_domain_whitelist: function(cb) { facebook_botkit.api.messenger_profile.getAPI('whitelisted_domains', cb); }, + target_audience: function(payload) { + var message = { + 'target_audience': payload + }; + facebook_botkit.api.messenger_profile.postAPI(message); + }, + delete_target_audience: function() { + facebook_botkit.api.messenger_profile.deleteAPI('target_audience'); + }, + get_target_audience: function(cb) { + facebook_botkit.api.messenger_profile.getAPI('target_audience', cb); + }, home_url: function(payload) { var message = { home_url: payload