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.