Giter Club home page Giter Club logo

Comments (11)

dthyresson avatar dthyresson commented on August 26, 2024 11

I know this issue is closed, but as an FYI to future readers, be sure when subscribing to the page to enable the messaging_postbacks event.

To receive messages and other events sent by Messenger users, 
the app should enable webhooks integration.

Selected events: 

message_deliveries, messages, messaging_optins, messaging_postbacks

When I initially setup my bot and webhooks, I only enabled the messages event (as shown in the README image).

from facebook-messenger.

jgorset avatar jgorset commented on August 26, 2024 1

The logs should definitely say something – if you've registered a hook on :postback it should run that code, and otherwise it should say that it's ignoring the event. Did you remember to subscribe to the page? Also, please help us to help you by sharing your code.

from facebook-messenger.

jgorset avatar jgorset commented on August 26, 2024 1

Good catch, @dthyresson! I just got that image from Facebook's documentation, but it'd be good to update it with something that has all the right settings.

from facebook-messenger.

jgorset avatar jgorset commented on August 26, 2024 1

A quick reply is not a postback, @vedant1811. Here's the documentation on postbacks, and the documentation on quick replies.

from facebook-messenger.

alecrubin avatar alecrubin commented on August 26, 2024

Totally unrelated question, but is there a way to retrieve the sender's first name on either the message or postback method?

from facebook-messenger.

jgorset avatar jgorset commented on August 26, 2024

Did you figure the first question out...?

from facebook-messenger.

jgorset avatar jgorset commented on August 26, 2024

And yes, you can use the Graph API to query user data.

from facebook-messenger.

alecrubin avatar alecrubin commented on August 26, 2024

Ok thanks, yeah everything is working now!

from facebook-messenger.

vedant1811 avatar vedant1811 commented on August 26, 2024

Hello. I am still facing the same issue :(
After sending this, I get the 2 quick reply options:

  optin.reply(
      text: "Welcome #{user.name}! Should I notify you of job updates via messages?",
      quick_replies: [
          {
              content_type: 'text',
              title: 'Yes, definitely',
              payload: 'notifications-yes'
          },
          {
              content_type: 'text',
              title: 'No',
              payload: 'notifications-no'
          }
      ]

but the, after selecting the 'yes. definitely' option, nothing happens in the postback callback:

Bot.on :postback do |postback|
  postback_debug = {
      sender: postback.sender,
      payload: postback.payload,
  }
  Rails.logger.debug "New postback: #{postback_debug.to_s}"
  case postback.payload
    when 'notifications-yes'
      postback.reply(text: 'Great')
    when 'notifications-no'
      postback.reply(text: 'Okay :(')
    else
      raise "Cannot handle postback payload: #{postback.payload}"
  end
end

However, I do get a message callback with :text=>"Yes, definitely", as seen in my logs.

from facebook-messenger.

M-Abozaid avatar M-Abozaid commented on August 26, 2024

I'm facing the same issue, it only occurs when I do broadcast

from facebook-messenger.

MandalShankar avatar MandalShankar commented on August 26, 2024

I'm facing the same issue, Postbacks not Working for a particular facebook page but it is working for all other page. If am i doing any wrong with page setting pls help me

from facebook-messenger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.