Receiving Client Doesn't Get Their OnPrivateMessage Callback Called

Hello, I have a few problems with private messages here with Unity3D.

Currently, I'm using Photon Quantum SDK 1.2.4 and want to implement Photon Chat too. So, I download the SDK, and copying the "PhotonChat" Folder into my Assets Folder (didn't copy the PhotonLibs and PhotonRealtime because it will crash with my quantum sdk). Photon Chat sdk version is v4.1.4.4

I already implemented the subscribe message related things and it works fine, until I tried to implement private messages. The receiving client doesnt get the OnPrivateMessage callback called.

I'm using something like:
public void SendPartyInvite()
    {
        string target = "PikaTest1";
        chatClient.SendPrivateMessage(target, "SendInvite to: " + target);
    }

But, the PikaTest1 never got his OnPrivateMessageCallback called. Here's my OnPrivateMessage code:
public void OnPrivateMessage(string sender, object message, string channelName)
    {
        Debug.LogError("PIKALOG: " + sender + " - " + message + " - " + channelName);
    }

Here's my chat client creation code:
public void ConnectToChat(string userID)
    {
        ConnectionProtocol chatConnectionProtocol = ConnectionProtocol.Udp;
        chatClient = new ChatClient(this, chatConnectionProtocol);
        chatClient.ChatRegion = "Asia";

        Photon.Chat.AuthenticationValues authValues = new Photon.Chat.AuthenticationValues();
        authValues.UserId = userID;

        chatClient.Connect(photonChatAppID, appVersion, authValues);
    }

Can you investigate it if there's any problem with it or have a solution I can do?
Thanks.

Few notes:
1. the chatClient here's doesnt get null error pointer, and I got my ChatClientService called on Update Function.
2. I have them called the "ChatClient.UserID" logged on the OnConnected function, so I can make sure that the TargetUserId is correct when sending the private message.
3. It logged the message for the sender, but not for the receiving clients.

Comments

  • Hey,
    As far as I can see, all of this looks correct and complete. You do get callbacks in public chat, so the private message callback also has a registered target.

    I can not see the error yet. It looks ok.

    You are sure that it's not PikaTest1 who is sending the invite? Cause it always goes to a fixed target user?...


    Does the SDK include a sample? Please run that to try to reproduce the issue.
    Which package exactly did you (partially) import?
    Mail us the chat appid you're using, so we can check the server-side logs.
  • One note: The userID is case-sensitive.
    Make sure you did log on accordingly! Otherwise, yes, the callback will not be hit.
  • I'm pretty sure that I got the userID right.
    I first use the quantum SDK version 1.2.4, and then copying the "PhotonChat" from the photon chat sdk download page from the photon website (v4.1.4.4) (not importing from the asset store).

    I do some testing and after sending private message, however I dont get my OnSubscribe function called too... Isn't it supposed to subscribe to a:b channel?

    I'll mail you my app-id.
    Thanks.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @PIkakuni,

    Please make sure clients are joined to the same Region (servers) and connected to the same virtual application (AppId, AppVersion).