php - Facebook Real Time update not working as expected


I registered for real time updates feature and I verified it as well here's the response which I get when I tried to see whether my subscription was success or not

   "data": [
         "object": "user",
         "callback_url": "",
         "fields": [
         "active": true

Now when I made a post on my wall, I was expecting that facebook will call my callback url and things will get written to a text file

Here's code for callback-page.php

if ($method == 'GET' && $_GET['hub_mode'] == 'subscribe' && $_GET['hub_verify_token'] == 'Our1stFBApp') {

   echo $_GET['hub_challenge'];

  $updates = json_decode(file_get_contents("php://input"), true); 
  $myFile = "testFile.txt";
  $fh = fopen($myFile, 'w') or die("can't open file");
  $stringData = $updates;
  $stringData = $stringData.'Hello';
  fwrite($fh, $stringData);
  print_r($stringData, true));       



the file textFile.txt resides inside root directory.

But nothings getting written in that file. How will I know that the real-time update feature is working..any help would be greatly appreciated

People are also looking for solutions to the problem: php - Export Yii Models with Relations into diagram


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.