facebook-chat-api icon indicating copy to clipboard operation
facebook-chat-api copied to clipboard

Cannot receive "message" from api.listenMQTT when trying to change userAgent

Open khoakomlem opened this issue 3 years ago • 3 comments

First userAgent : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 -> WON'T WORK! So I decided to remove the "Chrome/91.0.4472.77": Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36 -> WORK!

Then i tested it on a different browser (mozilla firefox): Both 1.Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0 2.Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Firefox/89.0 (removed "Gecko/20100101") are not working 😢

khoakomlem avatar Jun 07 '21 17:06 khoakomlem

When change User-Agent, sometime Facebook will force you login into facebook.com, so it's use new GUI and it's can't listen MQLL like old GUI, because SeqID, why don't you try use stable User-Agent that'll help you running your bot?It's look like you use m.facebook but can listen everything

FuryCSProducer avatar Aug 27 '21 03:08 FuryCSProducer

This is indeed correct. I have run into this issue extensively as of late, and I was able to force the mobile version by using a mobile user-agent however that in itself was not enough.

I also updated all the URL references in the npm package for the chat-api to use m.facebook.com explicitly, upon doing so the issue is now fixed for me. I have also built in Marketplace support. This API is still very much viable, just needs a few tweaks! If you all want some extra hands, I am a dev.

lv185039 avatar Nov 08 '21 10:11 lv185039

I'm interesting your chat-api, how can I use that?

khoakomlem avatar Nov 09 '21 10:11 khoakomlem