0

I have application that get facebook post, comment, replied, & conversation on my facebook page. So that app(services) running without stop to checking is that new item(post/comment/replied/conversation) on that page, when reach request limit made into fb API(non-stop services), my facebook app has been timeout for any request for 30 minutes.

I have read about facebook Real-time API. It will sent notification to us when FB have any changes on notification, I have try but I did not get any useful respons from FB. Can anybody please show where is my mistake.

I have post FB subscription by using this:

Page_ID/subscriptions?access_token=My_APP_Token&object=page&fields=feed&callback_url=211.25.3.235/php/verify.php&verify_token=anbiz

Then at my local code (verify.php):

<?php 
    define('VERIFY_TOKEN', 'anbiz');
$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('updates.txt',  print_r($updates) , FILE_APPEND);
    $strword  = array($updates);
    $count = count($strword);
    $count = count($pieces);
    $myfile = fopen("count.txt", "w") or die("Unable to open file!");
    fwrite($myfile, $count);
    fclose($myfile);
    $myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
    fwrite($myfile, $updates);
    fclose($myfile); 
}

One more thing, there is the way to get this get subscription by using C# programming language?
Please Help. Thank You in advance.

Ifwat Ibrahim
  • 1,523
  • 4
  • 16
  • 28
  • 2
    Yes just write that code in C# instead – WizKid Apr 07 '15 at 03:29
  • What do you mean by, didn't get any useful response from FB? first of all, were you able to subscribe your app to the page update successfully? if not, then are you seeing anything in your server logs from facebook? if so, then facebook is actually pining your server but your callback is not sending the challenge back properly and hence it's an issue in your side and only you can fix. – ifaour Apr 13 '15 at 12:23

0 Answers0