Support Topics Documentation Slack YouTube Blog

Why user-token have a dash?

I’m using Unity to develop a mobile app, but the Backendless library for .Net had some problems with net core, so I decided to use REST service. To transform the responses from REST service, the users api return a dash in user-token field, and I need to replace before to transform in a class, because properties with dash are not allowed.

Is there a reason behind the dash ? I noticed other fields are camel case.

Thank you.

Hi Dario,

The user-token is a special property which identifies the current user session. The value of user-token should be sent as an HTTP request header in all subsequent invocations. If you process REST responses and convert them to classes, the user-token property/value requires special processing.

Regards,
Mark

Hi Mark,

Thank you,
Somehow, at the beginning, I didn’t see the youtube video where you explain how integrate Backendless SDK in Unity, now I’m working with it and works great.

After add the plugin to the GameObject I receive some warnings. Probably something is missing to set. The Inspector already have the AppID and ApiKey (prod & dev)

Can you provide me some guidence?

Thanks

Assets/BackendlessSDK/BackendlessPlugin.cs(144,28): warning CS0168: The variable ‘e’ is declared but never used
Assets/BackendlessSDK/BackendlessPlugin.cs(58,37): warning CS0649: Field ‘BackendlessPlugin.DevelopmentAppID’ is never assigned to, and will always have its default value null
Assets/BackendlessSDK/BackendlessPlugin.cs(62,37): warning CS0649: Field ‘BackendlessPlugin.ProductionAppID’ is never assigned to, and will always have its default value null
Assets/BackendlessSDK/BackendlessPlugin.cs(60,37): warning CS0649: Field ‘BackendlessPlugin.DevelopmentApiKey’ is never assigned to, and will always have its default value null
Assets/BackendlessSDK/BackendlessPlugin.cs(64,37): warning CS0649: Field ‘BackendlessPlugin.ProductionApiKey’ is never assigned to, and will always have its default value null

Hi again Mark

after some successful tests in Unity IDE, I decided to try in mobile, but the app fails when register user is called, The only error i can get is “Internal client exception, Default constructor not found for type Weborb.V3Types.ErrMessage”. Have you tried to run the sdk in mobile (the same error is for ios and android)

Hi Dario,

Are you calling Backendless.InitApp in your code?

Regards,
Mark

Hi Mark,

Yes, this is the code I use:

try
{
Backendless.InitApp(“xxxxxxx”, “xxxxxx”);
BackendlessUser backendlessUser = new BackendlessUser();
backendlessUser.Email = email.text.Trim();
backendlessUser.Password = password.text.Trim();
backendlessUser.SetProperty(“name”, userName.text.Trim());
backendlessUser = Backendless.UserService.Register(backendlessUser);
Backendless.UserService.Login(email.text.Trim(), password.text.Trim(), true);
}catch (Exception exception){
EasyMessageBox.Show(exception.ToString(), messageBoxTitle: “¡Error!”, button1Text: “Aceptar”);
}

In the game window works without problems, but not in mobile, this screen is the plugin in the canvas.

Try to use the asynchronous (non-blocking version) of the Register method. I suspect the blocking calls might be breaking the execution on mobile since they are generally not allowed.

HI,

I got the same error:

What is your version of assembly?
Regards, Nikita

Hi Nikita

BackendlessSDK-UnityPackage-5.2.0.unitypackage
Unity v.2019.3.14f1

Thanks.

Hi Nikita

Could you reproduce the error? Is there something that I forgot to set?

regards,

Hi @Dario_Castaneda,

I just pushed the latest build of the Unity package to our git repo (v.5.5.1):

Could you please give it a try and see if the error goes away?

Regards,
Mark

Hi Mark,

I appreciate the package update, but, Now I have another error when I try to run in Android:

Fatal error in Unity CIL Linker
Mono.Linker.MarkException: Error processing method: ‘System.Void BackendlessAPI.Backendless::InitApp(System.String,System.String)’ in assembly: ‘Backendless.dll’ —> Mono.Cecil.ResolutionException: Failed to resolve System.Boolean

I’ve tried with “Api Compatibility Level” using .NET 4x and .NET Standard 2.0, My "Scripting backend is IL2CPP.

Do I need to set any additional configuration?


Failed running /Applications/Unity/Hub/Editor/2019.3.14f1/Unity.app/Contents/il2cpp/build/deploy/net471/UnityLinker.exe -out="/Users/dcastaneda/Google Drive/Workspaces/Unity/xxio/Temp/StagingArea/assets/bin/Data/Managed/tempStrip" -x="/Users/dcastaneda/Google Drive/Workspaces/Unity/xxio/Temp/StagingArea/assets/bin/Data/Managed/…/platform_native_link.xml" …

stdout:
Fatal error in Unity CIL Linker
Mono.Linker.MarkException: Error processing method: ‘System.Void BackendlessAPI.Backendless::InitApp(System.String,System.String)’ in assembly: ‘Backendless.dll’ —> Mono.Cecil.ResolutionException: Failed to resolve System.Boolean Quobject.EngineIoClientDotNet.Modules.LogManager::Enabled
at Mono.Linker.Steps.MarkStep.HandleUnresolvedField (Mono.Cecil.FieldReference reference) [0x00018] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Mono.Linker.Steps.MarkStep.MarkField (Mono.Cecil.FieldReference reference) [0x0002d] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00044] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x000e9] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Unity.Linker.Steps.UnityMarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00001] in :0
at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x001ca] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Unity.Linker.Steps.UnityMarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00041] in :0
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00021] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
— End of inner exception stack trace —
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00052] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue () [0x00019] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Mono.Linker.Steps.MarkStep.Process () [0x0013c] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x0000e] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Unity.Linker.Steps.UnityMarkStep.Process (Mono.Linker.LinkContext context) [0x00058] in :0
at Mono.Linker.Pipeline.ProcessStep (Mono.Linker.LinkContext context, Mono.Linker.Steps.IStep step) [0x0000e] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Unity.Linker.UnityPipeline.ProcessStep (Mono.Linker.LinkContext context, Mono.Linker.Steps.IStep step) [0x00018] in :0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00014] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0
at Unity.Linker.UnityDriver.Run () [0x0009b] in :0
at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling () [0x00007] in :0
at Unity.Linker.UnityDriver.RunDriver () [0x00002] in :0
stderr:

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:126)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:71) UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable1, String&, String&, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:166)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String&, String&, IEnumerable1, UnityLinkerRunInformation) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:159) UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(UnityLinkerRunInformation) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:301) UnityEditorInternal.AssemblyStripper:StripAssemblies(String, BaseUnityLinkerPlatformProvider, IIl2CppPlatformProvider, RuntimeClassRegistry, ManagedStrippingLevel) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:178) UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:327) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:65)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

Hi,

I decided to use REST instead Unity plugin.

I appreciate the help.

regards