Comments (10)
Hello @Ismael-sm thank for the feedback. You right, I will add it in the doc.
For the QuickReply event, it's not a bug. Cf. to the documentation, when you click on a quick reply this send back a message event. A quick reply is not only a posback. It's return the text too and a Location can be set as an attachment if the quick reply content-type is define as location
.
But I will add some methods as shortcut in the MessageEvent:
MessageEvent::isQuickReply() : bool
MessageEvent::getQuickReplyPayload() : null|string
MessageEvent::isLocation() : bool
MessageEvent::getLocation() : null|array
This seem good to you ?
from fb-messenger-sdk.
from fb-messenger-sdk.
Have you fork this repo first ? Please look to the github doc : https://guides.github.com/activities/contributing-to-open-source/
from fb-messenger-sdk.
handle webhook please !
from fb-messenger-sdk.
Hi, can you add how to send quickReplies in the documentation please?
$message = new FBMessenger\Model\Message(<QUICK_REPLIES_TITLE_TEXT>);
$message->setQuickReplies([
new Model\QuickReply('Option1', 'YOUR_PAYLOAD_HERE'),
new Model\QuickReply('Option2', 'YOUR_PAYLOAD_HERE')
]);
$this->messenger->sendMessage(<USER_ID>, $message);
from fb-messenger-sdk.
Something i thing is a bug is that when i click on a QuciReply i receive it as a message_event and not as a postback_event, because i need to is_null($event->getMessage()->getQuickReply()) instean of just receiving it as a postback_event
from fb-messenger-sdk.
Hi @tgallice :), your fast response is apreciated. I'm not sure if this is the rigth way to do this, but i created a "MessengerController" class which have a function called processUpdate($webookHandler->getAllCallbackEvents()); and in this function i have this
foreach ($events as $event) {
/**
* https://developers.facebook.com/docs/messenger-platform/webhook-reference#setup
*/
switch ($event->getType()) {
case 'message_event':
$this->processMessage($event);
break;
case 'message_read_event':
break;
case 'message_delivery_event';
break;
case 'message_echo_event';
break;
case 'authentication_event':
break;
case 'account_linking_event':
$this->processAccountLinking($event);
break;
case 'postback_event';
$this->processPostback($event);
break;
case 'raw_event';
break;
}
}
You maybe can implement some kind of handler that invokes a function dependent of the type of the event.
Like
$messenger->onMessage(...);
$messenger->onPostback(...);
etc or you can manage the postsbacks as "commands"
$messenger->addCommand/postbackHandler(<CLASS>);
But well that is just ideas, you are the programmer ;)
from fb-messenger-sdk.
@tgallice I really don't know how this git think works, it says i don't have permission to push when i click to Sync, and i see mine commits in the app, but cannot see them here in the website? :s
from fb-messenger-sdk.
Thank's @tgallice, i made the pull request now ^^
from fb-messenger-sdk.
TODO list:
can you add the send API endpoint and is_reusable field on attachments?
and/or field is_reusable on payload of class Image/File/Attachment
thanks!
from fb-messenger-sdk.
Related Issues (20)
- Bump version to match example HOT 1
- List template? HOT 6
- Typing indicator is missing HOT 4
- PHP Notice: Undefined index: app_id in wwwroot\vendor\tgallice\fb-messenger-sdk\src\Model\Callback\MessageEcho.php on line 76 HOT 4
- wrong content_type key in quick reply HOT 1
- Support for the new Persistent Menu features HOT 2
- Option to send a message to multiple user at a time
- Generic Template - Add "image_aspect_ratio"
- How can i access the "getAttachments" of message received? HOT 1
- Basic use fails: Call to undefined method Tgallice\FBMessenger\Messenger::create() HOT 9
- How to add Quick Reply by values returned in SQL Query HOT 1
- Carousel cards
- Send API Reference "messaging_type" HOT 3
- Parameter must be an array or an object
- How to send quickreply with buttons template? HOT 1
- Customer Chat Plugin
- How can I use "Media Template Reference"?
- Doesn't support nginx as server
- Multiple buttons
- The last_ad_referral and is_payment_enabled fields are now deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fb-messenger-sdk.