OneSignal / onesignal-dotnet-api

Other
13 stars 12 forks source link

[Bug]: Cannot add device with device_type = 0 #15

Open phuongvd201 opened 2 years ago

phuongvd201 commented 2 years ago

What happened?

Cannot add device with device_type = 0

Steps to reproduce?

1. call CreatePlayerAsync with DeviceType = 0
2. Error return {\"errors\":[\"device_type is required\"]}

What did you expect to happen?

Be able to create device with device_type = 0

Relevant log output

No response

Code of Conduct

phuongvd201 commented 2 years ago

image I believe that DeviceType with integer datatype and IsRequire attribute, So the value = 0 does NOT pass the validation

rer145 commented 1 year ago

I am experiencing the same issue on my end. Worked before in July, but stopped working sometime in August.

I did a manual post to the REST api with the same parameters (using 0 for device_type) and it succeeded.

rer145 commented 1 year ago

I dug into the code and changes some more. It looks like PR #12 fixed the issue (setting EmitDefaultValue to true), and was merged in, but no release has been made with that change.

PR #12 was merged September 1, but the last release is from August 4th.