How to customise Android notifications sounds
- Dominant language
- Go
- Stars
- 8.8k
- Forks
- 887
- PR merge metrics
- No merged PRs in 30d
Description
I'm using gorush to send FCM and APN notifications and in my Flutter app I use messaging fcm library for notificaitons.
I've been trying to customise the notifications in Android and it works to change the icon, title, message but the sound I am unable to make it work. Do you have an example on how we should send the payload to gorush to be able to send the needed notification?
I've been trying to send channel_id and or sound but nothing works.
```
type GorushNotification struct {
Tokens []string `json:"tokens" binding:"required"`
Platform int `json:"platform" binding:"required,oneof=1 2"`
Title string `json:"title" binding:"required"`
Message string `json:"message" binding:"required"`
Priority string `json:"priority" binding:"omitempty"`
Data map[string]string `json:"data" binding:"omitempty"`
Android *AndroidConfig `json:"android,omitempty"`
}
type AndroidConfig struct {
Notification *AndroidNotification `json:"notification,omitempty"`
}
type AndroidNotification struct {
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
Sound string `json:"sound,omitempty"`
ImageURL string `json:"image,omitempty"`
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names no repository files, tests, or entry points; start by tracing how the shown AndroidConfig and AndroidNotification fields are handled in gorush's Android notification payload. Confirm the required channel and sound behavior with the Flutter messaging setup, then document a working payload example and its expected Android notification result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, flutter, go
- Domain
- mobile-dev
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100