Hello again.
I seem to be also stuck on the messaging system. I've managed to post messages on our server fine, and if I load them using the demo scene, I can load them fine. But if I load them with this code...
Mail.Load(eMailList.Both, 0, 3, (messagesReceived, count, pagesCount, error) => {
...I get back an empty list. It seems your demo scene loads "conversations" if there are no messages loaded yet but I just want to load all messages to and from the user that's logged in. Am I doing something wrong?
You are trying to load the page number "0" with "3" records per page, so you're not receiving any results because "page 0" does not exist. The results of Load (as for any other classes in Combu) are paginated so you must load one page at time (the callback will pass you the total number of pages available and the total number of records so you can also implement an infinite scrolling when the user drags the list in your UI by continuously load until you've loaded all pages), you cannot load ALL the messages at once because it would generate very high traffic and the performance of your MySql server could be hit so much.
FRANCESCO CROCETTI @ SKARED CREATIONS
Thanks for the response.
However, I also tried with "1, 3" instead of "0, 3", and I still didn't get any messages. (Also, does the count really start at 1 instead of the usual programming way where you count from 0 up? Or does 0 not exist for some other reason?)
Oh I see, you're requesting eMailList.Both but this list type requires a recipient user Id or group Id (it's used to display a thread-like view of conversation between the user and another user or a group), that is you should use the overload of Mail.Load for example:
Mail.Load(eMailList.Both, 2, 0, 0, 1, 3, yourCallback); // Request page 1 with 3 messages to/from user with Id=2
Mail.Load(eMailList.Both, 0, 0, 2, 1, 3, yourCallback); // Request page 1 with 3 messages to/from group with Id=2
FRANCESCO CROCETTI @ SKARED CREATIONS
OK, so there's no way to just get all of my (recent, page-by-page) sent and received messages in one list?
By the way, it would be very nice if this returned some kind of informative error message.
Is six the maximum number of messages I can download at once? It seems if I ask for 10, I get 6 even though I know there should be more messages.
Nope, I'm testing this code and I get 10 messages:
Debug.Log(messagesReceived.Length);
});
FRANCESCO CROCETTI @ SKARED CREATIONS