Skip to content

Commit

Permalink
Compatible with old parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Dec 24, 2021
1 parent 1dfa4a8 commit 00df94f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion route_push.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ func push(c *fiber.Ctx, params map[string]interface{}) error {
case "body":
msg.Body = val
case "sound":
msg.Sound = val + ".caf"
// Compatible with old parameters
if strings.HasSuffix(val, ".caf") {
msg.Sound = val
} else {
msg.Sound = val + ".caf"
}
default:
msg.ExtParams[strings.ToLower(string(key))] = val
}
Expand Down

0 comments on commit 00df94f

Please sign in to comment.