title: Can a Facebook Group send the News Feed?
body: <p>I am trying to develop a fb app that should send the news feed to a website;</p>
  
  <p>I managed to subscribe using the app_id and app_secret but i don't get the news feed;</p>
  
  <pre><code>public function actionSubscription() {
          $app_id = '691036934243090';
          $app_secret = 'ca6e828f41c638dba4fb0864f7d9f6e8';
          $app_url = 'http://www.ghidul-comercial.ro';
          $fields = 'feed';
          $verify_token = 'blabla';
  
          // Fetching an App Token
          $app_token_url = 'https://graph.facebook.com/oauth/access_token?client_id='
                  . $app_id . '&amp;client_secret=' . $app_secret
                  . '&amp;grant_type=client_credentials';
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $app_token_url);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          $res = curl_exec($ch);
          parse_str($res, $token);
  
          if (isset($token['access_token'])) {
              // Let's register a callback
              $params = array(
                  'object'
                  =&gt; 'page',
                  'fields'
                  =&gt; $fields,
                  'callback_url'
                  // This is the endpoint that will be called when
                  // a User updates the location field
                  =&gt; $app_url . '/index.php/site/api',
                  'verify_token'
                  =&gt; $verify_token,
              );
  
              curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/'
                      . $app_id . '/subscriptions?access_token='
                      . $token['access_token']);
              curl_setopt($ch, CURLOPT_POST, 1);
              curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
              $res = curl_exec($ch);
              if ($res &amp;&amp; $res != 'null') {
                  print_r($res);
              }
  
              // Fetch list of all callbacks
              curl_setopt($ch, CURLOPT_POST, 0);
              $res = curl_exec($ch);
          }
          if ($res &amp;&amp; $res != 'null') {
              print_r($res);
          }
          curl_close($ch);
          error_log('test');
      }
  </code></pre>
  
  <p>This is how i intend to catch the feed:</p>
  
  <pre><code>public function actionApi() {
      $data = new Data();
      $data-&gt;info = '1';
      $data-&gt;save(false);
  
      $method = $_SERVER['REQUEST_METHOD'];
      $data = new Data();
      $data-&gt;info = $method;
      $data-&gt;save(false);
  
      $rawdata1 = file_get_contents('php://input');
      $rawdata2 = json_decode($HTTP_RAW_POST_DATA,true);
      $rawdata2 = json_decode(file_get_contents('php://input'),true);
  
  
      $data = new Data();
          $data-&gt;info = $rawdata1;
          $data-&gt;save(false);
  
      if ($method == 'GET' &amp;&amp; isset($_GET['hub_mode']) &amp;&amp; $_GET['hub_mode'] == 'subscribe' &amp;&amp; isset($_GET['hub_verify_token']) &amp;&amp; $_GET['hub_verify_token'] == 'blabla') {
          echo $_GET['hub_challenge'];
          exit;
      } elseif ($method == 'POST') {
          $post = file_get_contents("php://input");
          $data = new Data();
          $data-&gt;info = $post;
          $data-&gt;save(false);
      }
  
      $data = new Data();
      $data-&gt;info = '2';
      $data-&gt;save(false);
  }
  </code></pre>