Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when reading Announcements with rewards in C#MS code #3359

Open
allister-beamable opened this issue Apr 30, 2024 · 3 comments
Open

Error when reading Announcements with rewards in C#MS code #3359

allister-beamable opened this issue Apr 30, 2024 · 3 comments
Labels
public-bug a bug report submitted by the community

Comments

@allister-beamable
Copy link
Contributor

allister-beamable commented Apr 30, 2024

Describe the bug

Reported by a customer: await Services.Announcements.GetCurrent(); in C#MS code throws a Newtonsoft.Json.JsonSerializationException saying Error converting value "Rewards" to type 'Beamable.Common.Content.OptionalString'. Path 'announcements[2].gift.description'

Similar code works fine in Unity client code, and players are able to claim rewards from Announcements, but things blow up when C#MS code tries to read Announcements with rewards.

To Reproduce
Steps to reproduce the behavior:

  1. Create an Announcement with rewards on it somehow (could be Content, could be a Messaging Campaign)
  2. Write a ClientCallable that uses Services.Announcements.GetCurrent();
  3. Invoke the ClientCallable

Expected behavior

Announcements.GetCurrent() returns a list of announcement data objects, some of which contain reward descriptions.

Actual behavior

An exception is thrown from somewhere inside GetCurrent()

Metadata

  • SDK version: Beamable Unity SDK 1.19.17
@allister-beamable allister-beamable added the public-bug a bug report submitted by the community label Apr 30, 2024
@cdhanna
Copy link
Collaborator

cdhanna commented May 2, 2024

btw- you can also create an announcement via content.

@cdhanna
Copy link
Collaborator

cdhanna commented May 2, 2024

does sending any DTO with an OptionalString work?

@cdhanna
Copy link
Collaborator

cdhanna commented May 2, 2024

the hint is to look at UnitySerializationSettings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
public-bug a bug report submitted by the community
Projects
None yet
Development

No branches or pull requests

2 participants