Skip to content
This repository has been archived by the owner on Jan 28, 2018. It is now read-only.

Add php webhook implementation #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jerryheir
Copy link

Pure Php Code

Copy link
Author

@jerryheir jerryheir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 5, I made an error of using a variable that doesn't match make with the one in other parts of the code... I updated in another commit by changing it to $accessToken. I also used comment syntax /* and // but some of them will be removed when the code is been put to use

*/
//This other function is for sending curl requests for the reply.

?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jerryheir, this looks much more involved that the accompanying js version. What do you think of something like:

<?php
//replace <VERIFY_TOKEN> here with the verify token you specified on messenger dashboard
$hubVerifyToken = '<VERIFY_TOKEN>';

if ($_REQUEST['hub_verify_token'] === $hubVerifyToken){
    echo $_REQUEST['hub_challenge'];
} else {
    echo "Invalid verify token";
}
?>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants