Enable sending notifications via gRPC to FCM topic (#531)

This commit is contained in:
Maxim Shilov 2020-07-09 14:46:52 +07:00 committed by GitHub
parent 7b7d27f16c
commit 300fdc2f22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -68,6 +68,10 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot
notification.Badge = &badge notification.Badge = &badge
} }
if in.Topic != "" && in.Platform == gorush.PlatFormAndroid {
notification.To = in.Topic
}
if in.Alert != nil { if in.Alert != nil {
notification.Alert = gorush.Alert{ notification.Alert = gorush.Alert{
Title: in.Alert.Title, Title: in.Alert.Title,