I was wondering how does the API tell us whenever the server has answered a CKError which provides information to retry after x seconds.
As I see in the NSError class we have:
So I was wondering if we ever get one answer like serverBusy or others that I've seen that return the amount of seconds you should wait to retry,
where do we gather it?
Apple provides this by means of a "userInfo" dictionary on the NSError object. It's a dictionary where the keys are strings, and the values are untyped.
This dictionary is not currently exposed in the plugin, as there isn't a great way to pass a dictionary with untyped values from C to C#. It's not impossible per-se, but the work involved is quite complex. Part of the issue is that what is actually in this dictionary changes depending on what the error is.
Been thinking about it regardless. One quick solution is to serialize the entire dictionary as a string and send this up to Unity for inspection. As easy as that would be it's not very elegant. Another is to expose a series of "getIntForKey", "getStringForKey" methods that require the end-user to know the type of the data they need for a given key (which is documented)
The third...well I don't want to think about the third, it's almost more complicated than every other bit of the plugin combined. I'm leaning toward the second option.
Not receiving any error message of that kind.
But I have been watching all the WWDC videos from the '14 one and on error handling they talk about how to handle them well using this method,
and since it may happen in a near future I would rather to be ready.