Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you add more than five topics in FCM, the push doesn't send #40

Open
AndyGaskell opened this issue Oct 29, 2020 · 0 comments
Open

If you add more than five topics in FCM, the push doesn't send #40

AndyGaskell opened this issue Oct 29, 2020 · 0 comments
Labels
bug Something isn't working documentation question Further information is requested

Comments

@AndyGaskell
Copy link
Collaborator

AndyGaskell commented Oct 29, 2020

This is an odd one, but in FCM, if you add more than 5 topics, the message doesn't send.

This is really unhelpful in Firebase.

It's mentioned in the docs...
https://firebase.google.com/docs/cloud-messaging/send-message

There is discussion about it at...
https://stackoverflow.com/questions/44413037/how-to-send-fcm-push-notifications-to-multiple-topics

I was thinking we could throw an exception when a 6th topic is added.

At the very least we can mention this in the docs, in #39 Improve documentation

So, a 5 topic test ...

# set up the notification
$notification = new \Fcm\Push\Notification();

# send the push
$notification = $client->pushNotification($title, $body, "");
$notification->addTopic("mytopic_all");
$notification->addTopic("mytopic_nursery");
$notification->addTopic("mytopic_year1");
$notification->addTopic("mytopic_year2");
$notification->addTopic("mytopic_year3");
$response = $client->send($notification);

echo "response: ";
print_r($response);

Works fine, and returns...

response: Array
(
    [message_id] => 7035919789268175198
)

And a 6 topic / channel test ...

# set up the notification
$notification = new \Fcm\Push\Notification();

# send the push
$notification = $client->pushNotification($title, $body, "");
$notification->addTopic("mytopic_all");
$notification->addTopic("mytopic_nursery");
$notification->addTopic("mytopic_year1");
$notification->addTopic("mytopic_year2");
$notification->addTopic("mytopic_year3");
$notification->addTopic("mytopic_year4");
$response = $client->send($notification);

echo "response: ";
print_r($response);

Will not send the message to anyone, and returns...

response: Array
(
)
@AndyGaskell AndyGaskell added bug Something isn't working documentation question Further information is requested labels Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant