Git Product home page Git Product logo

Comments (5)

EdwinHoksberg avatar EdwinHoksberg commented on June 14, 2024

Hi @rolinger, it could be that Google changed the output. Because I don't actually use this package a lot could you create a merge request to change the documentation? Thanks!

from php-fcm.

rolinger avatar rolinger commented on June 14, 2024

@EdwinHoksberg I am rereading FCM documentation this morning. It turns out your documentation on expected responses is not wrong - there are multiple types of responses based on message type. There are 3 different types of protocols to communicate push notification messages and I am not fully understanding the difference between the three.

  1. HTTP v1 API - I don't fully understand this one - this might be client APP direct to FCM server API - not certain though
  2. XMPP Server protocol - I think this is just an xml version of the json oriented protocol.
  3. Legacy HTTP Server Protocol - app server to client app via FCM. This is whats being used in this fcm-php repository, not certain why they refer to it as legacy though

The below are references to the Legacy HTTP Server Protocol

  1. Sets up who you are trying to communicate with (IDs, Topics, etc) https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream-http-messages-json
  2. This defines the message / notfication payload (ie: sound,icon, badge, etc): Notice, there are 2 tables: 2a for iOS and 2b for Android - finding the overlap is probably the better/universal way to go: https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support
  3. The response messages:
    a. https://firebase.google.com/docs/cloud-messaging/http-server-ref#interpret-downstream
    b. Table 5: to or registration_ids JSON response (this is whats defined in your documentation
    c. Table 6: topic JSON response - this is what I am getting when sending messages to my groups
    d. Table 7 (Success) & Table 8 (Error) - responses to plain text (non JSON) HTTP messages

Your documentation is right...I just need to add additional documentation for both how to send notifications to a topic and for the topic responses.

from php-fcm.

rolinger avatar rolinger commented on June 14, 2024

@EdwinHoksberg In our php code, do these needed to be added per platform? - or does FCM just ignore the options in notifications that are/aren't supported by each platform? Lets add support for all of this - make this repository useful for everyone.

iOS only:
* badge
* subtitle

Android only:
* tag
* color (added)
* android_channel_id
* icon (added)

Both:
* title (done)
* body (done)
* sound (added)
* click_action
* body_loc_key
* body_loc_args
* title_loc_key
* title_loc_args

from php-fcm.

rolinger avatar rolinger commented on June 14, 2024

Added support for all of the following and also updated and clarified the Message docs, you should be able to merge them now.

iOS only:

  • badge (added)
  • subtitle (added)

Android only:

  • tag (added)
  • color (added)
  • icon (added)

Both:

  • title (done)
  • body (done)
  • sound (added)

from php-fcm.

rolinger avatar rolinger commented on June 14, 2024

closing this thread, opening a new master with all combined.

from php-fcm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.