Code Monkey home page Code Monkey logo

Comments (3)

blopa avatar blopa commented on June 16, 2024

Hello @dominik04u. First of all, thanks for using our module.

I got many issues requests about the Facebook Challenge Hub. This was hard to code because I needed to create a "pure text" page with no HTML tags.

Some modules add blocks to all Magento pages and it may overwrite the webhook URL, which must NOT contain any blocks. Try looking for these blocks and exclude the itby adding <remove name="BLOCK_NAME" /> at Magento-Root/app/design/frontend/base/default/layout/werules_chatbot.xml

You should also check the URL like in this #60 (comment)

Please try that and let me know.

from magento-chatbot.

dominik04u avatar dominik04u commented on June 16, 2024

I changed your code a little. I changed this method:

`public function verifyWebhook($hub_token) {
			if ($this->data['hub_verify_token'] == $hub_token) {
				return $this->data['hub_challenge'];
			}
			return false;
		}

to this:

public function verifyWebhook($hub_token) {
			if ($_REQUEST['hub_verify_token'] == $hub_token) {
				return $_REQUEST['hub_challenge'];
			}
			return false;
}

because it always was null in my case., because $rawData = file_get_contents("php://input"); always was null. Then the URL callback in fb was saved. I send messages to my bot, but it still doesn't work. I don't know why php://input was null, and I don't know if messages are receive. Do you have idea what can be wrong?

--UPDATE--

I added this in php.ini

allow_url_fopen = on

allow_url_include = on

Callback URL works only with $_REQUEST

from magento-chatbot.

dominik04u avatar dominik04u commented on June 16, 2024

Ok. I repaired this, but I have another problem. Your plugin wants information like
$this->data["entry"][0]["messaging"][0]["referral"]["ref"]
or
$this->data["entry"][0]["messaging"][0]["postback"]["payload"];
but request from facebook doesn't have them.

from magento-chatbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.