Search code examples
facebook-php-sdk

php facebook sdk want to create subscription for real-time updates


got this error every time if I change verify_token value or server request method.

{"error":{"message":"(#2201) response does not match challenge, expected value = '1383165001', received=''","type":"OAuthException","code":2201}}{"data":[]}

Solution

  • Your script just needs to return the challenge back to Facebook, so it can verify the response. I do the following in my script:

    // return hub.challenge to facebook
    echo isset( $_GET['hub_challenge'] ) ? $_GET['hub_challenge'] : false;
    

    It basically just echos the challenge sent by Facebook back to it.