CasperLaiTW / fb-messenger-demo

MIT License
2 stars 0 forks source link

Route / Webhook ? #1

Closed seatechdev closed 7 years ago

seatechdev commented 7 years ago

What are you using as the webhook in this case? I didn't see any entires under the routes.

CasperLaiTW commented 7 years ago

can you run php artisan route:list you will get the webhook path.

if you don't want to use /webhook you can change config at custom_url

2017-02-10 2 19 25
CasperLaiTW commented 7 years ago

route will auto load from RouteServiceProvider

CasperLaiTW commented 7 years ago

@sbasi5576

Can you screenshot your Facebook App setting?

this is mine. 2017-02-10 2 38 31

seatechdev commented 7 years ago

Yes i just saw that and submitted the webhook and it accepted it. I have updated the .env file with my token and verify token as well. But when i open the bot in messenger it doesn't do anything. It also doesn't reply back even if I ping it. I have added the csrf token exception in the middleware for webhook

Also in the subscription are we supposed to have only messages, messaging_account_linking, messaging_optins, messaging_postbacks or can I we have more fields?

CasperLaiTW commented 7 years ago

can you show your route:list?

seatechdev commented 7 years ago

----------------------+ | Domain | Method | URI | Name | Action | Middleware | +--------+----------+--------------------+------+----------------------------------------------------------------------+-----------------------------------------------------------+ | | GET|HEAD | / | | Closure | web | | | GET|HEAD | api/user | | Closure | api,auth:api | | | GET|HEAD | fb-messenger/debug | | Casperlaitw\LaravelFbMessenger\Controllers\DebugController@index | | | | GET|HEAD | webhook | | Casperlaitw\LaravelFbMessenger\Controllers\WebhookController@index | Casperlaitw\LaravelFbMessenger\Middleware\RequestReceived | | | POST | webhook | | Casperlaitw\LaravelFbMessenger\Controllers\WebhookController@receive | Casperlaitw\LaravelFbMessenger\Middleware\RequestReceived | +--------+----------+--------------------+------+----------------------------------------------------------------------+-----------------------------------------------------------+

seatechdev commented 7 years ago

webhook

CasperLaiTW commented 7 years ago

Ok, I think webhook not in CSRF protected

seatechdev commented 7 years ago

I have <?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

class VerifyCsrfToken extends BaseVerifier { /**

CasperLaiTW commented 7 years ago

Do you subscribe your pages?

2017-02-10 2 47 29

seatechdev commented 7 years ago

yes

seatechdev commented 7 years ago

This is where it stays[image1.PNG]

On Feb 9, 2017, at 10:48 PM, Casper Lai notifications@github.com<mailto:notifications@github.com> wrote:

Do you subscribe your pages?

[2017-02-10 2 47 29]https://cloud.githubusercontent.com/assets/5094008/22817011/ebac4ca8-ef9f-11e6-919c-7a98f86552c5.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/CasperLaiTW/fb-messenger-demo/issues/1#issuecomment-278870644, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AD694NyM9dSx4GeHMKqhhLVfNYg5sZecks5rbAgwgaJpZM4L9A5z.

CasperLaiTW commented 7 years ago

I think you don't add /webhook to VerifyCsrfToken.

do you publish config??

seatechdev commented 7 years ago

i removed the verifycsrftoken webhook exception and republished the config. No changes. It still is not wokring.

CasperLaiTW commented 7 years ago

is any laravel error log? please check storage/logs/laravel.log

seatechdev commented 7 years ago

Please see below. I have taken my facebook id number and messenger number id out and replaced with some text... everything else is the same. This is without any exceptions in the verifycsrftoken.

[2017-02-10 08:18:49] local.INFO: Broadcasting [Casperlaitw\LaravelFbMessenger\Events\Broadcast] on channels [laravel-fb-messenger] with payload: { "id": "2017-02-10 08:18:49", "webhook": { "object": "page", "entry": [ { "id": "someid", "time": 1486714729383, "messaging": [ { "sender": { "id": "someid" }, "recipient": { "id": "somid" }, "timestamp": 1486714729245, "message": { "mid": "mid.some string", "seq": 30766, "text": "Hi" } } ] } ] }, "request": { "recipient": { "id": "someid" }, "sender_action": "typing_on" }, "response": { "recipient_id": "someid.." }, "status": 200, "socket": null }

CasperLaiTW commented 7 years ago

can you send Show Menu via chatbot. and any response?

it look success for received and responded

seatechdev commented 7 years ago

Show Menu actually worked and I was able to go through the product list

On Feb 10, 2017, at 12:25 AM, Casper Lai notifications@github.com<mailto:notifications@github.com> wrote:

can you send Show Menu via chatbot. and any response?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/CasperLaiTW/fb-messenger-demo/issues/1#issuecomment-278885129, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AD694IheoqG84-sJWMKiTaTgG799MTeyks5rbB7egaJpZM4L9A5z.

seatechdev commented 7 years ago

I would recommend that you list the commands such as show Menu in your readme. Thank you for your help

On Feb 10, 2017, at 12:25 AM, Casper Lai notifications@github.com<mailto:notifications@github.com> wrote:

can you send Show Menu via chatbot. and any response?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/CasperLaiTW/fb-messenger-demo/issues/1#issuecomment-278885129, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AD694IheoqG84-sJWMKiTaTgG799MTeyks5rbB7egaJpZM4L9A5z.

CasperLaiTW commented 7 years ago

ha, sorry I will add this. Sorry about spent your time.

seatechdev commented 7 years ago

Please don't be sorry. You solved a big problem for me. Thank you for your help.

On Feb 10, 2017, at 12:36 AM, Casper Lai notifications@github.com<mailto:notifications@github.com> wrote:

ha, sorry I will add this. Sorry about spent your time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/CasperLaiTW/fb-messenger-demo/issues/1#issuecomment-278887093, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AD694IdKAx--sahzXUkspYWRJJ4rc0C-ks5rbCGKgaJpZM4L9A5z.