NIKO_B
NIKO_B

Reputation: 189

$_POST is empty in push notification response (PHP)

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));

Upvotes: 0

Views: 129

Answers (1)

Martin Zeitler
Martin Zeitler

Reputation: 76679

try something alike:

file_put_contents('response-data.txt', file_get_contents('php://input'));

Upvotes: 1

Related Questions