feat(grpc): support category, alert and badge for ios. (#321)
This commit is contained in:
@@ -48,6 +48,7 @@ func (s *Server) Check(ctx context.Context, in *proto.HealthCheckRequest) (*prot
|
||||
|
||||
// Send implements helloworld.GreeterServer
|
||||
func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*proto.NotificationReply, error) {
|
||||
var badge = int(in.Badge)
|
||||
notification := gorush.PushNotification{
|
||||
Platform: int(in.Platform),
|
||||
Tokens: in.Tokens,
|
||||
@@ -55,6 +56,13 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot
|
||||
Title: in.Title,
|
||||
Topic: in.Topic,
|
||||
APIKey: in.Key,
|
||||
Category: in.Category,
|
||||
Badge: &badge,
|
||||
Alert: gorush.Alert{
|
||||
Title: in.Alert.Title,
|
||||
Body: in.Alert.Body,
|
||||
Subtitle: in.Alert.Subtitle,
|
||||
},
|
||||
}
|
||||
|
||||
go gorush.SendNotification(notification)
|
||||
|
||||
Reference in New Issue
Block a user