i saw post on subscribe facebook page feed real time updates
i have same problem. in comment there solution , make post https://graph.facebook.com/pageid/tabs?app_id=appid&access_token=page_access_token when post in browser shows data. unable understand how url helps real time updates , how use it. have got after subscription completed: { "data": [ { "object": "page", "callback_url": "http://www.i4mass.com/demo/fb.php", "fields": [ "feed" ], "active": true } ] }
which means subscription ok. callback.php code:
<?php define('verify_token', 'mystring'); $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') { if ( isset( $_server['http_x_hub_signature'] ) ) { $post_body = file_get_contents("php://input"); if ($_server['http_x_hub_signature'] == "sha1=" . hash_hmac('sha1', $post_body, verify_token)) { $object = json_decode($post_body, true); foreach($object->entry $update) { file_put_contents('updates.txt', $update, file_append); } } } } ?>
Comments
Post a Comment