We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad81955 commit ec0c489Copy full SHA for ec0c489
main.go
@@ -156,15 +156,13 @@ func sendNotificationMultipleDevice(c *gin.Context) {
156
Condition: req.Condition,
157
FCMOptions: req.FCMOptions,
158
}
159
- response, _ := fcmClient.Send(context.Background(), message)
+ response, err := fcmClient.Send(context.Background(), message)
160
161
- // if err != nil {
162
- // log.Printf("Send message error: %v", err)
163
- // c.JSON(http.StatusInternalServerError, gin.H{"error": "Send message error!."})
164
- // return
165
- // }
166
-
167
- responses = append(responses, response)
+ if err != nil {
+ responses = append(responses, err.Error())
+ } else {
+ responses = append(responses, response)
+ }
168
169
170
c.JSON(http.StatusOK, gin.H{
0 commit comments