From 300fdc2f220f988c7c8b210737e1b53e28c083b6 Mon Sep 17 00:00:00 2001 From: Maxim Shilov Date: Thu, 9 Jul 2020 14:46:52 +0700 Subject: [PATCH] Enable sending notifications via gRPC to FCM topic (#531) --- rpc/server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpc/server.go b/rpc/server.go index aedb820..9213826 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -68,6 +68,10 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot notification.Badge = &badge } + if in.Topic != "" && in.Platform == gorush.PlatFormAndroid { + notification.To = in.Topic + } + if in.Alert != nil { notification.Alert = gorush.Alert{ Title: in.Alert.Title,