Open nutella opened 1 week ago
I've tried with something like:
$data = []; $data['id'] = 10; $data['link'] = 'https://www.github.com'; $client -> build($recipient, $notification, $data);
But got this error: "Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 3 passed to phpFCMv1\Client::build() must be an instance of phpFCMv1\Data or null, array given"
...but $data is an array...
What's wrong?
Thanks.
This seems to work:
$data = new Data(); $foo['id'] = 10; $foo['link'] = 'https://www.github.com'; $bar['data'] = $foo; $data->setPayload($bar); $client -> build($recipient, $notification, $data);
I've tried with something like:
$data = []; $data['id'] = 10; $data['link'] = 'https://www.github.com'; $client -> build($recipient, $notification, $data);
But got this error: "Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 3 passed to phpFCMv1\Client::build() must be an instance of phpFCMv1\Data or null, array given"
...but $data is an array...
What's wrong?
Thanks.