Git Product home page Git Product logo

Comments (11)

AndyGaskell avatar AndyGaskell commented on June 14, 2024

Hi @rayansys

Could you provide a bit more info please? Perhaps some detail on what you're trying to do and where you hit this issue.

Fireball cloud messaging doesn't really have channels, but topics instead. Topics are fully supported by php-fcm.

More info...

https://firebase.google.com/docs/cloud-messaging/android/topic-messaging

https://php-fcm.readthedocs.io/en/latest/message.html#notification-message-topics

Sorry if I've misunderstood the issue.

from php-fcm.

rayansys avatar rayansys commented on June 14, 2024

The notification's channel id (new in Android O).

The app must create a channel with this channel ID before any notification with this channel ID is received.

If you don't send this channel ID in the request, or if the channel ID provided has not yet been created by the app, FCM uses the channel ID specified in the app manifest.

from php-fcm.

AndyGaskell avatar AndyGaskell commented on June 14, 2024

Thanks for the quick reply.

The php-fcm library just really wraps functionality in provided by firebase cloud messaging. If you can point us to the fcm docs about channels, that'd be handy.

Previously I've used other messaging systems that used the term channels, like Appcelerator ACS. It was my understanding that the concept channels is kind of implemented as topics now in FCM, but I'm not really sure.

from php-fcm.

rolinger avatar rolinger commented on June 14, 2024

@AndyGaskell @rayansys - yeah, I don't understand the request. TopicIDs are managed by php-fcm. Can you point us to some documentation about what you are referring to please?

from php-fcm.

rayansys avatar rayansys commented on June 14, 2024

https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidnotification

from php-fcm.

AndyGaskell avatar AndyGaskell commented on June 14, 2024

Thanks for the link. I'll do some reading on that. I guess we've not implemented it because it's Android only.

from php-fcm.

rolinger avatar rolinger commented on June 14, 2024

@AndyGaskell - I did a quick read, it looks like channel ID allows you to setup different types of notifications within your app which then allows users to turn off/on specific types of Push Notifications versus just ALL ON or ALL OFF. Which I do like. It allows the user to customize, via Android settings, what components inside each app can notify and how they can notify (sound, buzz, popup, silent in background, etc). I wonder if Apple will do the same soon too?

https://developer.android.com/guide/topics/ui/notifiers/notifications#ManageChannels

from php-fcm.

rayansys avatar rayansys commented on June 14, 2024

just add "android_channel_id" to request header

from php-fcm.

AndyGaskell avatar AndyGaskell commented on June 14, 2024

Cool, am understanding it a bit more now. Thanks for the notes @rolinger

I guess we've only ever implemented the cross platform features of FCM, we could do the platform specific ones too.

So, looking at https://firebase.google.com/docs/reference/fcm/rest/v1/projects.message we could add other functions to add android, webpush and apns. This could maybe be done in the same way as the addData, so we'd have $notification->addAndroidConfig($android_config_object);, $notification->addWebpushConfig($webpush_config_object); and $notification->addApnsConfig($apns_config_object); This is a bit like how the FirebasePHP lib does it, see https://firebase-php.readthedocs.io/en/5.7.0/cloud-messaging.html#adding-target-platform-specific-configuration

Another option, which would be much quicker, would be to just add another parameter to the Notification constructor for the channel. Then, I guess, add a setChannel function. If we did it this way it'd just work in the same way as sounds, icon, colour etc. It'd be a bit of a mess if we wanted to add other platform specific options though.
https://github.com/EdwinHoksberg/php-fcm/blob/master/src/Push/Notification.php

One thing I'm a bit worried about is how we'd test all this, at a system level.

Also @rayansys I'm a bit confused about how you mention adding it to the header. From the docs it looks like it goes in the json body.

from php-fcm.

AndyGaskell avatar AndyGaskell commented on June 14, 2024

Thanks for the PR @rayansys this is a nice simple aproach, but I'm not sure how it'll scale out to other Android, iOS and Web config options.

PR at...
Update Notification.php #30

from php-fcm.

Mike-Benoit avatar Mike-Benoit commented on June 14, 2024

Thanks for the PR @rayansys this is a nice simple aproach, but I'm not sure how it'll scale out to other Android, iOS and Web config options.

PR at...
Update Notification.php #30

This functionality would be really nice to have, @AndyGaskell will you only accept a design similar to what you described in your previous comment regarding addAndroidConfig(), addApnsConfig()?

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.