Cannot use SmartFox Send command

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

longnt
Posts: 19
Joined: 16 Oct 2020, 02:02

Cannot use SmartFox Send command

Postby longnt » 28 May 2021, 10:25

I'm using a fairly simple chat system that user sending other chat message using the SmartFox.Send(new PublicMessageRequest(message, data));
It's working fine on Unity Editor, Android, but it's not working on iOS. This is what I got from the my debug logger

Code: Select all

Parameter name: s
  at System.Text.Encoding.GetBytes (System.String s) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.Util.ByteArray.WriteUTF (System.String str) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.BinEncode_UTF_STRING (Sfs2X.Util.ByteArray buffer, System.String val) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.EncodeObject (Sfs2X.Util.ByteArray buffer, System.Int32 typeId, System.Object data) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.Obj2bin (Sfs2X.Entities.Data.ISFSObject obj, Sfs2X.Util.ByteArray buffer) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.EncodeObject (Sfs2X.Util.ByteArray buffer, System.Int32 typeId, System.Object data) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.Obj2bin (Sfs2X.Entities.Data.ISFSObject obj, Sfs2X.Util.ByteArray buffer) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.EncodeObject (Sfs2X.Util.ByteArray buffer, System.Int32 typeId, System.Object data) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.Obj2bin (Sfs2X.Entities.Data.ISFSObject obj, Sfs2X.Util.ByteArray buffer) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.Core.SFSIOHandler.OnDataWrite (Sfs2X.Bitswarm.IMessage message) [0x00000] in <00000000000000000000000000000000>:0
  at Sfs2X.SmartFox.Send (Sfs2X.Requests.IRequest request) [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.Events.UnityAction.Invoke () [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1].Invoke (T1 handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0


What can I do to resolve this issue?
Unity: 2020.1.9f1
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Cannot use SmartFox Send command

Postby Lapo » 28 May 2021, 10:54

Hi,
does it fail on every public message you send? Or is it a specific text that causes the problem?
Also, what version of the SFS2X client API are you using?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
longnt
Posts: 19
Joined: 16 Oct 2020, 02:02

Re: Cannot use SmartFox Send command

Postby longnt » 28 May 2021, 14:04

Thanks, I've only use this feature for this specific chat feature only
And I don't know which client version I am currently using, only remember that it have been imported since Jan 2021(Currently I don't have some kind of Readme or something to show the current version).
I also have updated the client API newest version 1.7.14 (After I found this issue) but haven't run the test on the real device yet because of some thing has been break with other library (currently XCode saying the FBSDK has been broken, will try to look into that)
In worse case scenario I think I might have to change to the send custom request to continue to support the feature!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Cannot use SmartFox Send command

Postby Lapo » 28 May 2021, 15:13

Hi,
you can see the version of the C# API you are using by printing out the Version property of the SmartFox object.

For instance:

Code: Select all

var sfs = new SmartFox();
Debug.Log("Version: " + sfs.Version);


Also what version of XCode are you using to compile the project?

Let us know.
Lapo

--

gotoAndPlay()

...addicted to flash games
longnt
Posts: 19
Joined: 16 Oct 2020, 02:02

Re: Cannot use SmartFox Send command

Postby longnt » 31 May 2021, 01:56

Sorry for late reply,
I've checked and I have SmartFox C# client 1.7.12 and my XCode is 12.4 (12D4e)
Some android got same problem too. My other devices is reporting log as the same as the iOS, but my Samsung A80 (Android 11) seem to be working as normal. :/
Edit: After some more research I finally "some how" make it error on editor and every android devices I have, still don't know what cause it.
longnt
Posts: 19
Joined: 16 Oct 2020, 02:02

Re: Cannot use SmartFox Send command

Postby longnt » 31 May 2021, 07:24

The issue seem to be related with my system account. On one hand if the account is sign in with Google Sign In or Facebook Sign In there're no error. But if the account is signed in with email then the error occurred. I'm using Firebase Authentication for the sign in system. Will report more if I find anything else.
Are there any limitation of PublicMessageRequest object?
Edit: It's my fault, a String object that I passed in is "null" so the library cannot get byte of that object. Sorry for any inconvenient

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 43 guests