Open Duddde opened 5 months ago
According to OneSignal Support, I need to use the IncludeExternalUserIds
property instead of ExternalId
. Indeed it seems to work. However, the IncludeExternalUserIds property is marked as deprecated by the SDK.
Do you think this is the right solution?
The API return does not looks good...
class CreateNotificationSuccessResponse {
Id: 9481f102-ae46-4bfa-907e-fa8949a00aed
Recipients: 0
ExternalId:
Errors:
}
Accordingly with their documentation it is supposed to use the include_aliases
property but I could not make it work with it. My Notification:
Notification notification = new(appId: "<MY_APP_ID>")
{
IncludeAliases = new PlayerNotificationTargetIncludeAliases(["<EXTERNAL_ID>"]),
TargetChannel = Notification.TargetChannelEnum.Push,
Contents = new StringMap(en: "Hello world from .NET"),
Subtitle = new StringMap(en: "Testing"),
};
Response:
class CreateNotificationSuccessResponse {
Id:
Recipients: 0
ExternalId:
Errors: class Notification200Errors {
ActualInstance: System.Collections.Generic.List`1[System.String]
}
But using the deprecated IncludeExternalUserIds
it did work:
Notification notification = new(appId: "<MY_APP_ID>")
{
IncludeExternalUserIds = ["<EXTERNAL_ID>"],
TargetChannel = Notification.TargetChannelEnum.Push,
Contents = new StringMap(en: "Hello world from .NET"),
Subtitle = new StringMap(en: "Testing"),
};
But it does have a kind of weird response:
class CreateNotificationSuccessResponse {
Id: f1266639-78e0-477e-9977-48a223b410e2
Recipients: 0
ExternalId:
Errors:
}
@Duddde Thank you for reporting. I am going to move this issue to the .net api Github repository since I believe this is an issue with the backend SDK and not this repo. To confirm are you able to receive the notification when you create the push notification using the web dashboard or using the REST API directly?
Thanks for your feedback. Yes i'm able to receive notifications from the dashboard or my API.
What happened?
I'm trying to send notification with ExternalId. I do not receive anything. But when the external Id is null, i receive the notification on my device.
On my .Net MAUI APP i'm using
OneSignal.Login(userId.ToString());
to register the connected user.But in my subscriptions i have two with the same Id's (it's maybe the problem)
Any idea of what's the problem ?
Steps to reproduce?
What did you expect to happen?
I expect to receive notification when using externalId
Relevant log output
Code of Conduct