Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FB Broadcast Messages API #1180

Merged
merged 14 commits into from
Jan 18, 2018

Conversation

ouadie-lahdioui
Copy link
Collaborator

Hello,

This PR add the new FB Broadcast API to send a message to many recipients.

Enjoy 👽

Copy link
Contributor

@jonchurch jonchurch left a 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) {
Copy link
Contributor

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

Copy link
Collaborator Author

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) {
Copy link
Contributor

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

Copy link
Collaborator Author

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) {
Copy link
Contributor

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

@ouadie-lahdioui
Copy link
Collaborator Author

Thank you @jonchurch for the review 👍

@senorcodecat
Copy link

Hey, is this going to be accepted into the base soon? Any timeline?

@benbrown benbrown merged commit 669cec3 into howdyai:master Jan 18, 2018
@aidonsnous
Copy link

aidonsnous commented Jan 19, 2018

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.

@ouadie-lahdioui ouadie-lahdioui deleted the feature/FbBroadcastAPI branch January 19, 2018 10:09
@ouadie-lahdioui
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants