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

How to send to topic ? #11

Open
cybersasi opened this issue Mar 2, 2018 · 0 comments
Open

How to send to topic ? #11

cybersasi opened this issue Mar 2, 2018 · 0 comments

Comments

@cybersasi
Copy link

cybersasi commented Mar 2, 2018

I have no problem sending message to single device with user token, but now i need to send notification to a topic what should i do?

This is my code

use NotificationChannels\FCM\FCMMessageTopic;

.....
  public function toFCM($notifiable)
    {
        return (new FCMMessageTopic())
            ->to($this->topic)
            ->notification([
                'title' => 'Notification title',
                'body' => 'Notification body',
            ]);
    }

and it return this error

FatalThrowableError in FirebaseNotification.php line 43:
Call to undefined method NotificationChannels\FCM\Exceptions\InvalidArgumentException::notification()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant