Hi,
content.Tags is always null for me, even though the content was created with the tag IDs defined in the Unity Dashboard.
The content is retrieved with GetContentTrends and GetPlayersContent, in both cases tags are null.
Hi,
content.Tags is always null for me, even though the content was created with the tag IDs defined in the Unity Dashboard.
The content is retrieved with GetContentTrends and GetPlayersContent, in both cases tags are null.
I had this same problem occur when I created the content with the tags in name form. I found out you have to put the tags in ID form in order for it to work.
Here’s an example code snippet:
public async Task<List<string>> GetTagsAsIDs(IEnumerable<string> tagNames)
{
var candidateTags = await UgcService.Instance.GetTagsAsync();
var foundTags = candidateTags.Where(t => tagNames.Contains(t.Name));
var foundTagsInIDs = foundTags.Select(t => t.Id)
.ToList();
return foundTagsInIDs;
}
Then you just create the args with the new tags:
string name = "";
string description = "";
List<string> tags = new() { "modern", "rustic", "historic" };
var args = new CreateContentArgs(name, description, null) // replace null with filestream
{
TagsId = await GetTagsAsIDs(tags)
// other args
};