How can we help?
Hello,
I am using create notification API with included_aliases to send the notification to the specified user by external_id.
aliasExternalIds := &onesignal.PlayerNotificationTargetIncludeAliases{
AdditionalProperties: map[string]interface{}{
"external_id": []string{receiverId},
},
}
notification.IncludeAliases = *onesignal.NewNullablePlayerNotificationTargetIncludeAliases(aliasExternalIds)
notification.IncludeExternalUserIds = []string{receiverId}
targeChannel := "push"
notification.TargetChannel = &targeChannel
// notification.IncludedSegments = []string{"Total Subscriptions"}
var iosBadgeCount *int32 = new(int32)
*iosBadgeCount = 1
notification.IosBadgeCount = *onesignal.NewNullableInt32(iosBadgeCount)
iosBadgeType := "Increase"
notification.IosBadgeType = *onesignal.NewNullableString(&iosBadgeType)
appAuth := context.WithValue(context.Background(), onesignal.AppAuth, nd.oneSignalConfig.RestApiKey)
successResponse, _, err := nd.oneSignalApiClient.DefaultApi.CreateNotification(appAuth).Notification(notification).Execute()
But it is failed. It return the invalid_aliases.
{
"id": "b15ba6e5-2223-49d6-9eda-684b9051f5a8",
"external_id": null,
"errors": {
"invalid_aliases": {
"external_id": [
"bnudasdfRUt4yUJh0912E63tzIXPsxq1"
]
}
}
}
What's wrong?
Please help me to fix it.
Thank you so much!
Code of Conduct
How can we help?
Hello,
I am using create notification API with included_aliases to send the notification to the specified user by external_id.
But it is failed. It return the
invalid_aliases.What's wrong?
Please help me to fix it.
Thank you so much!
Code of Conduct