Dear PlayFab community,
I have the same problem as this thread.
However, none of the resolutions in the thread seem to apply to me. As far as I can tell, I've got everything configured properly on both ends, but none of my WebHooks are getting triggered.
I'm following the Photon PlayFab integration instructions.
Here are my Photon settings in Unity:
And a successful connection is made with the following C# code:
private static string Version = "0.1"; private void ConnectPhoton(string PlayFabId, string token /*from PlayFabClientAPI.GetPhotonAuthenticationToken()*/) { // Set up the Photon authentication aspects. AuthenticationValues authenticationValues = new AuthenticationValues(); authenticationValues.AuthType = CustomAuthenticationType.Custom; authenticationValues.AddAuthParameter("username", PlayFabId); authenticationValues.AddAuthParameter("token", token); PhotonNetwork.AuthValues = authenticationValues; // Connect to Photon. PhotonNetwork.ConnectUsingSettings(Version); }
Photon AppID: f3416d52-4d66-4ac0-9d8a-75b545a8925d
(Note that the BaseUrl has the SECRET_KEY appended and is not shown here. I have confirmed that this is the same value that appears in the PlayFab Photon Add-On module.)
PlayFab (AppID: 44b1) CloudScript:
interface IPhotonResult { ResultCode: number, Message: string } const photonSuccess: IPhotonResult = { ResultCode: 0, Message: 'Success' }; var RoomCreated = function(args: any, context?: IPlayFabContext): IPhotonResult { Log.Debug("photon_room_created", JSON.stringify(args)); WritePlayerEvent("photon_room_created", args); return photonSuccess; } var RoomClosed = function(args: any, context?: IPlayFabContext): IPhotonResult { WritePlayerEvent("photon_room_closed", args); return photonSuccess; } var RoomJoined = function(args: any, context?: IPlayFabContext): IPhotonResult { Log.Debug("photon_room_joined", JSON.stringify(args)); WritePlayerEvent("photon_room_joined", args); return photonSuccess; } var RoomLeft = function(args: any, context?: IPlayFabContext): IPhotonResult { WritePlayerEvent("photon_room_left", args); return photonSuccess; } var RoomEventRaised = function(args: any, context?: IPlayFabContext): IPhotonResult { WritePlayerEvent("photon_room_event_raised", args); return photonSuccess; } var RoomPropertyUpdated = function(args: any, context?: IPlayFabContext): IPhotonResult { WritePlayerEvent("photon_room_property_updated", args); return photonSuccess; } var WebRPCTest = function(args: any, context?: IPlayFabContext): IPhotonResult { WritePlayerEvent("photon_webrpc_test", args); return photonSuccess; } handlers["roomCreated"] = RoomCreated; handlers["roomClosed"] = RoomClosed; handlers["roomJoined"] = RoomJoined; handlers["roomLeft"] = RoomLeft; handlers["roomEventRaised"] = RoomEventRaised; handlers["roomPropertyUpdated"] = RoomPropertyUpdated; handlers["webRPCTest"] = WebRPCTest;
Thoughts?
Answer by Brendan · Jun 21, 2018 at 02:49 AM
Actually, the logs show that the handlers are being called. The problem is that your WritePlayerEvent calls are invalid, and so cause the handlers to error out. The base Cloud Script example (Revision 1 in all new titles) shows some examples of how to make a Server API call.
Ahhh...thanks, I see that now. I thought that WritePlayerEvent was so simple that there wasn't any way for me to screw it up. ;-)
Is there a way for me to see the logs for those kinds of calls? That would have helped me to debug this issue.
Yes, use try/catch for all Server API calls, and log the error you get on any catch.
How can I debug this further? It seems like I don't have access to these internal logs...
I've responded in the other thread you started on this - here, for the sake of others: https://community.playfab.com/questions/20786/photon-webhooks-not-triggered-redux.html
Photon WebHooks not triggered (redux). 7 Answers
Photon chat webhooks not firing 2 Answers
Photon Webhooks Problem 3 Answers
Photon webhooks not wokring 2 Answers
Photon webhooks are not triggered 2 Answers