Sending a message to multiple devices - Symfony 3.4/PHP 7.4 #887
-
Hi, We have a project that uses the excellent Symfony Bundle for this library and currently sends messages to multiple devices at once using registration tokens and the sendMulticast() function which, in the version of the Bundle I have to use at the moment (2.5), uses the batch method that is soon to be removed. Looking through the code it looks like the single send method already using the new HTTP v1 API so from a maintenance point of view if I switched sendMulticast() to sending the message to each token individually that would maintain functionality, albeit with a potentially large process time and memory overhead? The application this serves is likely to only be sending to 1-2k recipients for any given single message and the nature of the message is not sensitive or urgent. However, it did occur to me that although I'm unable to upgrade the Firebase bundle due to being limited by the Symfony and PHP version the project is on, I could just use the firebase-php library directly up to v6.9.6, I think. Is there any real benefit over the v5.17.9 version the bundle uses and it's convenience? We'll be updating the version of Symfony/PHP eventually but for now that's what we gotta work with! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Using the SDK directly instead of the bundle would be my recommendation as well - the bundle is just a very thin wrapper that you could integrate into your project. As for the performance: once the legacy API is shut down and you migrate to sending the messages individually anyway, you could push the sends as individual jobs to a queue, this should improve performance by a lot. Going with version 6.x would have the benefit of having a chance to receive an update with backported support of the HTTP V1 API with much better performance for batched messages: @kevinvanmierlo has brought up that there's a chance he/his company might sponsor this feature and the project itself in #804 - but don't let that stop you from becoming a sponsor as well: looking at the impressive client list on your company's website, the SDK seems to play a part in your revenue as well 😅. |
Beta Was this translation helpful? Give feedback.
Using the SDK directly instead of the bundle would be my recommendation as well - the bundle is just a very thin wrapper that you could integrate into your project.
As for the performance: once the legacy API is shut down and you migrate to sending the messages individually anyway, you could push the sends as individual jobs to a queue, this should improve performance by a lot.
Going with version 6.x would have the benefit of having a chance to receive an update with backported support of the HTTP V1 API with much better performance for batched messages: @kevinvanmierlo has brought up that there's a chance he/his company might sponsor this feature and the project itself in #804 - but don'…