Backend code (Java)
Collection<Integer> data = new ArrayList();
sfsObj.putIntArray("data", data);
I got exception from Client side when I try this code;
sfsObject.GetValue<int[]>("data");
InvalidCastException: Unable to cast object of type 'SFSArrayLite' to type 'Int32[]'.
at Sfs2X.Entities.Data.SFSObject.GetValue[Object] (System.String key) [0x00000] in <filename unknown>:0
Unity version : 5.5.0f3
Smartfox Client version : 1.6.6
Smartfox Backend version : 2.9.2 ( Same error 2.12.0)
Plaform : WebGL (No problem on Android , IOS)
Unity C# SFSArrayLite cast Exception
-
- Posts: 30
- Joined: 30 Apr 2016, 07:23
- Location: Turkey
Re: Unity C# SFSArrayLite cast Exception
Actually the GetValue method is an internal method that you should not use.
Please use sfsObject.GetIntArray(). This should fix it.
PS: we will make that method private in future releases of the API, to avoid this situation.
Please use sfsObject.GetIntArray(). This should fix it.
PS: we will make that method private in future releases of the API, to avoid this situation.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Who is online
Users browsing this forum: No registered users and 50 guests