question

removed avatar image
removed asked

In what order are Title News returned in?

Is the order guaranteed? Are the newest news at the top?

Title News
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tyler Boesch avatar image Tyler Boesch commented ·

So I am having an issue with my news timestamps not matching up even close to what my game retrieves. The oldest timestamp gets displayed as result.News[0] then result.News[1] is the newest news item. I thought result.News[0] was supposed to be the newest. I even have my 3 news items' timestamps set correctly with the oldest timestamp for April 10th, then April 15th, then today. Yet the first item displayed is April 10th, then today's, then April 15th's. I attached my code for displaying the news data. Maybe I'm missing something horrendously obvious, but I can't see anything wrong? Help me out? :)

for(int i = 0; i < result.News.Count; i++) {
			gameObject.GetComponent<Text>().text += result.News[i].Timestamp + "\n" + "* " + result.News[i].Title + "\n" + "\n" + result.News[i].Body;
			gameObject.GetComponent<Text>().text += "\n" + "\n" + "\n" + "\n";
		}
0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

News items are ordered by most to least recent (so, element 0 of the array is the most recent), using the Timestamp set on them.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tyler Boesch avatar image Tyler Boesch commented ·

My order is not. Can you please take a look at my question here Brendan?
https://community.playfab.com/questions/29809/title-news-not-displaying-in-proper-order.html

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.