-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add FB Broadcast Messages API #1180
Add FB Broadcast Messages API #1180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Let me know what you think about these changes, but it's ready to go
} | ||
}); | ||
}, | ||
get_label_details: function(label_id, fields, cb) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the only available extra field for a label is name
, which I think we can just add as the default to this request and save the additional argument to get_label_details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put fields to prevents any futur break changes, Exactly, today, name is the only available field, bu FB can add some other ones.
lib/Facebook.js
Outdated
} | ||
}); | ||
}, | ||
get_all_label: function(fields, cb) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe get_all_label should be get_all_labels with an s? there is get_labels_by_user above
Same comment about the fields, I think we can just grab all fields by default since FB only lets us specify name
as an additional field currently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch 👍
} | ||
}); | ||
}, | ||
send: function(message_creative_id, custom_label_id, cb) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at the sendBroadcast function I created in this PR where we test if a creative_message_id
string is passed, or a fresh message/array of messages. I prefer that personally, saves the user a callback level if they don't need to store the creative_message_id
1996e93
to
7f56539
Compare
7f56539
to
669cec3
Compare
Thank you @jonchurch for the review 👍 |
Hey, is this going to be accepted into the base soon? Any timeline? |
Hey this is great; does it support adding multiple users with one request to a custom label? I am looking on how I can add [user1,user2,user3] directly a custom label. And also while going through the code I couldn't see a function to delete a broadcast. |
Hi @MagSag, FB broadcast API doesn't support associating multiple users to a label ! to add more than one user to specific label, you should make more than one api call. The same thing for deleting a broadcast message, it's not yet supported by FB Enjoy |
Hello,
This PR add the new FB Broadcast API to send a message to many recipients.
Enjoy 👽