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

Android notification payload in gRPC #549

Open
ghost opened this issue Nov 24, 2020 · 0 comments
Open

Android notification payload in gRPC #549

ghost opened this issue Nov 24, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 24, 2020

How can I send Android notification payload using gRPC?
gRPC NotificationRequest struct has a special field Alert for iOS alert payload, but there is no
such field for Android.

message NotificationRequest {
  repeated string tokens = 1;
  int32 platform = 2;
  string message = 3;
  string title = 4;
  string topic = 5;
  string key = 6;
  int32 badge = 7;
  string category = 8;
  Alert alert = 9;
  string sound = 10;
  bool contentAvailable = 11;
  string threadID = 12;
  bool mutableContent = 13;
  google.protobuf.Struct data = 14;
  string image = 15;
  enum Priority {
    Normal = 0;
    High = 1;
  }
  Priority Priority = 16;
}

message NotificationReply {
  bool success = 1;
  int32 counts = 2;
}

Also, looking at your code I have noticed that you hardcoded success value in NotificationReply to true

return &proto.NotificationReply{
		Success: true,
		Counts:  int32(len(notification.Tokens)),
	}, nil

I think this might be misleading.

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

0 participants