Closed Manidavid closed 7 years ago
As you can see on lib/facebook/messenger/incoming/postback.rb
You should do:
postback.payload["title"]
postback.payload["title"]
- it returns 'nil' instead of the title sting - Get Started
on [lib/facebook/messenger/incoming/postback.rb]()
def payload
@messaging['postback']['payload']
end
def title
@messaging['postback']['title']
end
I guess need to add method something likedef title
to get the title text.
@navidemad any suggestion on my above code?
i able to get the title from the below code
title = postback.messaging['postback']['title']
Need text of the title from the postback object.
<Facebook::Messenger::Incoming::Postback:0x0000000006416d00 @messaging={"recipient"=>{"id"=>"124495678232012"}, "timestamp"=>1510297448580, "sender"=>{"id"=>"1525496340849520"}, "postback"=>{"payload"=>"GET_STARTED_PAYLOAD", "title"=>"Get Started"}}>
something like - postback.text should return "Get Started"