appleboy / appleboy/gorush

Android notification payload in gRPC

Open
#549 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
8.8k
Forks
887
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the gRPC/protobuf definitions for NotificationRequest and NotificationReply, then trace the notification handler that constructs the reply. Determine how Android payload data should be represented and how success should reflect the operation; done means Android notifications can receive the intended payload and the reply reports the actual result.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, go, grpc
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.