question

brendan avatar image
brendan asked

GetContentList Unity problem

Oleg.ragozin
started a topic on Tue, 01 September 2015 at 1:13 AM

Hello

I have an issue in a code below:

public class FileUploader : MonoBehaviour {     

....

private void GetContentListURL() {
        Debug.Log ("Start creating file list");
        PlayFabAdminAPI.GetContentListCallback callback = delegate (GetContentListResult result) {
            Text[] textValue = GameObject.Find ("TextFileList").GetComponentsInChildren<Text> ();
            textValue[1].text = result.Contents.ToString();
            Debug.Log(string.Format("Finish creating file list"));
        };

        PlayFabAdminAPI.GetContentList (new GetContentListRequest {Prefix = ""}, callback, OnPlayFabError);
    }

The callback have never been called :(

The code works done in PlayFabHTTP.cs

            WWW www = new WWW(url, bData, headers);
            yield return www;

            if(!String.IsNullOrEmpty(www.error))
            {
                Debug.LogError(www.error);
                callback(null, www.error);
            }
            else
            {
                string response = www.text;
                callback(response, null);
            }

I have received the right responce in a "string response = www.text" but callback never been called in a next string

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

1 Comment
Brendan Vanous said on Tue, 08 September 2015 at 10:38 PM

Hi Oleg,

Sorry for the delay getting back to you - we'll be updating our support site shortly, to improve the overall support experience. If you ever don't hear back on an issue for a couple of days, please email us at devrel@playfab.com. We normally respond to all issues within 2 business days.

Reviewing your code, I'm not seeing anything which makes it apparent why your delegate wouldn't work. What version of the SDK are you using? Could you try updating to the latest version in GitHub? There have been quite a few changes to the SDK lately, so it possible this is something that's been fixed since.

Also, just for the sake of argument, could you try this call instead (I realize it doesn't set your textValue, this is just a test)?

PlayFabAdminAPI.GetContentList (new GetContentListRequest {Prefix = ""}, (result)=>{ Debug.Log("Callback Returned"); }, OnPlayFabError);

Brendan

10 |1200

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

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.