$_POST is empty in push notification response (PHP)

25
October 11, 2018, at 3:40 PM

Can anybody tell me how to get the response data from a push notification response. I am currently only able to get data from headers, but $_POST is an empty array. Can anybody push me in the right direction? (I get notifications from google and outlook.)

My notifications file contains code as below:

header('Content-Type: text/html; charset=utf-8');
header("HTTP/1.1 200 OK");
file_put_contents('response-data.txt', serialize($_POST));
Answer 1

try something alike:

file_put_contents('response-data.txt', file_get_contents('php://input'));
READ ALSO
Email Open Rate Tracker - Differences in email client

Email Open Rate Tracker - Differences in email client

I've implemented a very common approach to email open rate tracking using a 1x1px transparent image:

33
Redirect route to language prefix in Symfony 4

Redirect route to language prefix in Symfony 4

Since version 41, Symfony now handles multilingual routing without the need of an external plugin (https://symfony

22
How to persist an entity related to an already existing one?

How to persist an entity related to an already existing one?

I have seen a lot of examples about cascading with doctrine (including the doc) but every single example is about creating eg a new user, a new comment and saving both

41
Uncaught Zend_Cache_Exception: our Datas must be string or set automatic_serialization = true

Uncaught Zend_Cache_Exception: our Datas must be string or set automatic_serialization = true

I have created a page type from SilverStripe CMS and after save and publish screen goes blankAfter page refresh I have founded that page in Draf

29