You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, i m new user for this package and i cannot found send notification with tag filter. I share my send message service function is bellow. If can be help me, I would be very pleased.
func (s*OneSignalService) SendMessage(userIDs []uint64, Headingstring, Contentstring, priorityint32, notificationDatamap[string]interface{}) {
ids:=make([]string, len(userIDs))
fori, v:=rangeuserIDs {
ids[i] =fmt.Sprintf("%d", v)
}
notification:=*onesignal.NewNotification(s.AppID)
notification.SetIncludeExternalUserIds(ids)
varheading= onesignal.StringMap{}
heading.SetEn(Heading)
notification.Headings.Set(&heading)
notification.SetIosSound("RingBellTriple.wav")
notification.SetAndroidSound("RingBellTriple.wav")
notification.SetIsAndroid(true)
notification.SetIsIos(true)
notification.SetIsChromeWeb(true)
notification.SetIsChrome(true)
notification.SetIsSafari(true)
notification.SetIsFirefox(true)
notification.SetIsAnyWeb(true)
notification.SetIsAdm(true)
notification.SetIsHuawei(true)
ifnotificationData!=nil {
notification.SetData(notificationData)
}
varcontent= onesignal.StringMap{}
content.SetEn(Content)
notification.Contents.Set(&content)
notification.SetPriority(priority)
notification.SetTag("") // I think i will use this methot but i m not understand clearly, how can i set this propertiesifresp, _, err:=s.ApiClient.DefaultApi.CreateNotification(s.AppAuth).Notification(notification).Execute(); err!=nil {
fmt.Println("Error", err)
} else {
ifresp.GetErrors().ArrayOfString!=nil {
fmt.Println("Error", resp.GetErrors().ArrayOfString)
} else {
fmt.Printf(" - Response: %+v\n", "Success")
}
}
}
thanks a lot.
ici.
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
How can we help?
Hi all, i m new user for this package and i cannot found send notification with tag filter. I share my send message service function is bellow. If can be help me, I would be very pleased.
thanks a lot.
ici.
Code of Conduct
The text was updated successfully, but these errors were encountered: