go-fcm: push notification critical sound [closed]

徘徊边缘 提交于 2021-02-05 12:32:51

问题


We are using this the library on our Go server. We need to send push notification with special key for sound object My code looks like:

var NP fcm.NotificationPayload
NP.Sound = "alert.caf"
NP.Icon = "ic_alert"
NP.Color = "colorAccent"
NP.AndroidChannelID = "smartamsalarm"
data = map[string]string{
    "msg": "ALARM",
    "sum": "1",
}

But I need set key like here:

"sound": {  
    "critical": 1,
    "name": "your_custom_sound.aiff",
    "volume": 1.0
}

Can I do it with this library or I should to change?

来源:https://stackoverflow.com/questions/65995901/go-fcm-push-notification-critical-sound

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!