Why i can not connect to Photon chat ?
sawan
✭
I install Photon Chat from asset store and i tried to use the demo but its not make a connect (in the debug text still disconnected )
note : I live in Syria , is that maybe the reason of can not make a connect ?
note : I live in Syria , is that maybe the reason of can not make a connect ?
0
Answers
-
Hi @sawan,
In order to help you, please provide the following information:
- the code you use to connect to Photon Chat.
- Photon SDK you use and its version, target platform and game engine version if any.
- logs if any (screenshot or text).
N.B.: I hope your location is not a factor here and if I may, be safe!0 -
Thanks for replay @JohnTube
first , this is the code that i tried to connect to Photon Chat :public void Start() { DontDestroyOnLoad(gameObject); this.ChatPanel.gameObject.SetActive(true); Application.runInBackground = true; // this must run in background or it will drop connection if not focussed. if (string.IsNullOrEmpty(UserName)) { UserName = "user" + Environment.TickCount%99; //made-up username } this.chatClient = new ChatClient(this); string chatAppId = ChatSettings.Instance.AppId; this.chatClient.Connect(chatAppId, "1.0", new AuthenticationValues(UserName)); this.ChannelToggleToInstantiate.gameObject.SetActive(false); Debug.Log("Connecting as: " + UserName); }
And this "onConneted" function which is never calledpublic void OnConnected() { Debug.Log("yeeees conected :) "); if (this.ChannelsToJoinOnConnect != null && this.ChannelsToJoinOnConnect.Length > 0) { this.chatClient.Subscribe(this.ChannelsToJoinOnConnect, this.HistoryLengthToFetch); } }
About Photon SDK i work on Unity 3D SDK v4.1.0.4 , i don't modify anything (just in entered my AppID)
I worked on unity 5.1.3 and i want to build my game on android and windows (windows not nessesary)
When i run the project and tried to send message , this error appear
"PublishMessage called while not connected to front end server."
Thanks for your help
0 -
Please make sure to have this in your code to keep the connection alive and to get incoming messages.
void Update(){ chatClient.Service(); }
0 -
@JohnTube I am also facing the same issue. When I am trying to send a private message to a user it's showing an error sendprivatemessage called while not connected to frontend server.
I have connected to chat in one scene and it showed me connectedtofrontend but when I move to next scene and trying to send message it showed me that error. Is it because of scene changing? Please help me.0