@@ -57,13 +57,9 @@ func getChannelProperties(title, content string) AndroidChannelProperties {
5757 }
5858}
5959
60- // getXiaomiNoticeProperties 按推送类型从小米模板注册表与配置中选取模板 ,
60+ // getXiaomiNoticeProperties 按推送类型从配置中选取小米模板 ,
6161// 模板参数直接取调用方透传的 keywords[0],不做字符串反解
6262func getXiaomiNoticeProperties (pushType string , keywords []string , notice config.XiaomiNotice ) (string , * XiaomiExtraProperties ) {
63- _ , ok := xiaomiTemplateKinds [pushType ]
64- if ! ok {
65- return "" , nil
66- }
6763 template , ok := notice [pushType ]
6864 if ! ok {
6965 return "" , nil
@@ -90,9 +86,8 @@ func getXiaomiNoticeProperties(pushType string, keywords []string, notice config
9086}
9187
9288// PushByType 按推送类型同时下发安卓、iOS 与鸿蒙推送,任一端失败仅记录日志,不影响业务(尽力而为)。
93- // keywords 为模板参数(透传,不做字符串反解),例如成绩通知传 []string{courseName},正文由注册表拼装
94- func PushByType (pushType , title string , keywords []string , ticker , tag , description , deeplink string ) {
95- text := buildPushText (pushType , keywords )
89+ // text 由调用方按推送类型拼装好传入;keywords 为模板参数(透传复用,不做字符串反解),例如成绩通知传 []string{courseName}
90+ func PushByType (pushType , title , text string , keywords []string , ticker , tag , description , deeplink string ) {
9691 if err := SendAndroidGroupcastWithGoApp (pushType , title , text , ticker , tag , description , deeplink , keywords ); err != nil {
9792 logger .Errorf ("umeng.PushByType: %s failed to send Android groupcast: %v" , pushType , err )
9893 }
0 commit comments