feat(grpc): support category, alert and badge for ios. (#321)

This commit is contained in:
Bo-Yi Wu
2018-01-02 15:53:15 +08:00
committed by GitHub
parent a89d00c934
commit 8faae762fe
7 changed files with 751 additions and 31 deletions

View File

@@ -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)