문제

I set up a php server on a web host using this script I found from a website

<?php

define('VERIFY_TOKEN', 'DEVICETOKEN');
$method = $_SERVER['REQUEST_METHOD'];

if ($method == 'GET' && $_GET['hub_mode'] == 'subscribe' && $_GET['hub_verify_token']   == VERIFY_TOKEN) {
echo $_GET['hub_challenge'];


} else if ($method == 'POST') {
$updates = json_decode(file_get_contents("php://input"), true);

file_put_contents('/filepath/updates.txt',$updates, FILE_APPEND);

error_log('updates = ' . print_r($obj, true));
}

?>

I used the realtime update panel on facebook to subscribe to a simple user email request as a test, I get this error everytime.

Response does not match challenge, expected value = '1098150855',
received='1098150855<!-- www.s...'

How do I solve this problem?

도움이 되었습니까?

해결책

The only thing that should be outputted on your callback url is the hub.challenge parameter. Remove the comment after the 0855... and any other output and it should work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top