question

daniel-9 avatar image
daniel-9 asked

Unity SDK - FunctionParameter object arrives empty at the cloud script,Unity SDK: FuncionParameter object is arriving empty at the cloud script

This is happening to us on iOS and Android devices when Development Build is NOT checked. It doesn't happen on device with Development Build checked or on Editor. We are using Unity engine 2019.4.16f1.

This is the client code:

public void ClaimLevelUpReward(int levelId)
{
    ExecuteCloudScriptRequest cloudScriptRequest = new ExecuteCloudScriptRequest
    {
        FunctionName = "TheCloudScriptFunctionName",
        FunctionParameter = new { level = levelId }
    };

    PlayFabClientAPI.ExecuteCloudScript(cloudScriptRequest, OnRequestSuccess,
        OnRequestFailed);
}

And this is the function implementation on the cloud script:

handlers.TheCloudScriptFunctionName = function(args, context)
{
    log.debug('args', args);


    var level = null;
    if (args && args.hasOwnProperty("level"))
        level = args.level;
        
    log.debug('level', level);
    

    // Extra code omitted
}

The logs received are:

args {}

level

So the function parameter is arriving empty and level is null.

We tried to pass level as string with the same result.

unity3dCloudScript
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

·
Gosen Gao avatar image
Gosen Gao answered

I have done a quick test on Android Build with Development Build unchecked. But I can't reproduce this issue.

So far as I have learned that if the Development Build is checked Debug.isDebugBuild will be true. This should not affect the passing of parameters.

I found some "application works on Development Build only" kind questions in the Unity forum. Seems like this issue is related to Unity, you can contact with Unity for professional support.

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.