You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Facebook has two ways to let users of your web apps, opt in to receive messages, via "checkbox plugin" and "send to messenger". Payload received for these two in the subscribed webhook is different, in case of "checkbox plugin", facebook does not send the sender id rather it sends the user_ref inside optin node.
Currently botkit handles the "send to messenger" plugin correctly but breaks for "checkbox plugin" as shown in the following stack trace:
TypeError: Cannot read property 'id' of undefined
at Object.__dirname.Facebookbot.facebook_botkit.handleWebhookPayload (/home/nishant/work/orange/notifier/node_modules/botkit/lib/Facebook.js:320:58)
at /home/nishant/work/orange/notifier/node_modules/botkit/lib/Facebook.js:241:29
The text was updated successfully, but these errors were encountered:
The issue within botkit is that the optin event grabs the user id from the sender field, which is not present in Checkbox plugin webhook events.
ALSO! The user_id that is passed back is a "unique ref" and not the actual PSID, it can be used to message a user, but the outgoing message signature will look a lil different. Instead of sender.id it wants sender.user_ref and then that call to the send api will return the actual user PSID...
Facebook has two ways to let users of your web apps, opt in to receive messages, via "checkbox plugin" and "send to messenger". Payload received for these two in the subscribed webhook is different, in case of "checkbox plugin", facebook does not send the
sender id
rather it sends theuser_ref
insideoptin
node.Currently botkit handles the "send to messenger" plugin correctly but breaks for "checkbox plugin" as shown in the following stack trace:
The text was updated successfully, but these errors were encountered: