Firebase Cloud Messaging - return values

99 views
Skip to first unread message

Unyte s.a.r.l

unread,
Feb 16, 2021, 6:54:32 AM2/16/21
to Firebase Google Group
I have been unable to find any documentation that explains what is returned when I attempt to use the FCM API to post a message via PHP using the excellent Kreait/Firebase package.

Typically, here is what I do

    $factory = (new Factory)->withServiceAccount('/path/to/firebase_config.json');      
    $messaging = $factory->createMessaging(); 
    $condition = ...;//define a few conditions 
   $notif = ...;//define the notification $data = ...;//define some data to send 
    $message = CloudMessage::withTarget('condition',$condition)->
    withNotification($notif)- >withData($data); 
   $rslt = $messaging->send($message);  

Up until yesterday the result would bear the form {"code":1}.  However, I am now seeing this

    ""name":"projects/`project_id/messages/long_number"}{"code":1}

How is this to be interpreted.  Is it an error, does "code":1 imply success...?

Sam Stern

unread,
Feb 16, 2021, 6:57:07 AM2/16/21
to Firebase Google Group
Hi there,

I agree that PHP library is excellent but it's also not an official Firebase library, so most of us here are not familiar with the details of its API calls and return types. You may have better luck opening a GitHub issue with your question.

That said the library is pretty popular so maybe another FIrebase user on this mailing list happens to know the answer.

- Sam

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/243cbed2-52f2-4b1c-803a-fd2e3a8c83f5n%40googlegroups.com.

Unyte s.a.r.l

unread,
Feb 16, 2021, 7:09:57 AM2/16/21
to Firebase Google Group
Fair enough.  However, is there ANY Firebase documentation from Google that explains what the various calls to the Firebase API return?  Subscribing/unsubscribing from topics, sending out messages and then hoping that it has all gone well without interpreting the answer returned by the API does not feel like a reliable way to do things.
Reply all
Reply to author
Forward
0 new messages