Вопрос

I already added this URL to my subscribers list: http://push-pub.appspot.com/

BTW, I also setting well the callback URL, like: http://online-domain.com/data/forward

My controller code:

public function forward() {
    $this->autoRender = false
    CakeLog::write('debug', 'Callback work!!');
    CakeLog::write('debug', json_encode($this->request->data));
}

But, in my debug.log:

2013-12-23 06:06:47 Debug: Callback work!!
2013-12-23 06:06:47 Debug:
2013-12-23 06:07:38 Debug: Callback work!!
2013-12-23 06:07:38 Debug:
2013-12-23 06:12:59 Debug: Callback work!!
2013-12-23 06:12:59 Debug:

I no idea why $this->request->data not working, it should get the callback data from superfeedr. I want get callback from superfeedr. Any guys know what was I wrong? Thanks you in advance.

Это было полезно?

Решение

I am not familiar with CakePHP, however, I know that most frameworks will assume that the body of a POST request is the content from a form and hence will fail to show the content from a Superfeedr notification. You want to access the "raw" version of the BODY. This answer may be able to help (provided you can access the right variables directly).

Другие советы

You have to echo de hub_challege in get request. Somesthing like this.

  if(isset($_Get["hub_challenge"])){
   echo $_Get["hub_challenge"];
   return;
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top