CasperLaiTW / laravel-fb-messenger

Laravel Facebook Messenger Provider
MIT License
105 stars 27 forks source link

No defaultAction for GenericTemplate #80

Closed Iseldore closed 7 years ago

Iseldore commented 7 years ago

Hi again,

With ListTemplate we can add a defaultAction when the element is clicked, like your example :

$defaultButton = new UrlButton(null, 'https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template');
$template->addElement('Moving list', 'Help you to check all of them', 'http://www.mk-sokolovi.com/wp/wp-content/uploads/2013/07/T-shirt-Vector.jpg')
        ->setDefaultAction($defaultButton)
        ->buttons()
        ->addWebButton('View', 'https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template');

but we can't do the same thing with GenericTemplate while it is mentioned in the Messenger's docs : https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-template

It throws an exception : Call to undefined method Casperlaitw\LaravelFbMessenger\Messages\Element::setDefaultAction()

CasperLaiTW commented 7 years ago

Cool. Thank you catch.

I will implement.

CasperLaiTW commented 7 years ago

Hi, I released new version 1.4.7

Enjoy it :)