plokko / firebase-php

Php integration of Firebase API (FCM Http v1, RealTime database)
16 stars 9 forks source link

Request->submit #7

Closed ScoobyCoo closed 5 years ago

ScoobyCoo commented 5 years ago

Should the following code for the submit method

return ($json && isset($json['message']['name']))?$json['message']['name']:null;

not be

return ($json && isset($json['name']))?$json['name']:null;

As the message object doesn't exist it's just returning null.

andrewalf commented 5 years ago

@plokko Yes, that's true. I've just dumped the $json variable and it contains an array with "name" key. Is this a bug or I with @ScoobyCoo are missing something?

Also, maybe we should remove echo in the request? This seems like debug-like thing and forces to use text buffering

plokko commented 5 years ago

The echo seem a leftover from debugging; by the way i looked on the documentation and it seems you are correct: the response should be a Message object without "wrapping" like when it's sended. https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send#response-body

I'll fix ASAP, thanks.

plokko commented 5 years ago

Fixed