I have a listener for PlayFabMultiplayer.OnLobbyInviteReceived that correctly sees an invite from one player to another. The use case is to show the display name of the invitor to the person who received the invite. We're building in Unity.
The method catching the event receives entity information with invitor's title_player_account id. Here's the receiving method.
public static void xyz_HandleReceivedLobbyInvite(
PFEntityKey listeningEntityKey,
PFEntityKey invitorEntityKey,
string lobbyConnectionString )
{
Debug.Log($
"listeningEntityKey {listeningEntityKey.Id} {listeningEntityKey.Type}
invitorEntityKey {invitorEntityKey.Id} {invitorEntityKey.Type}
with connection string {lobbyConnectionString}");
}
I have validated the incoming values checking the information of the players involved in the invite and it is all correct... it is title info.
How do I get the invitor's display name using the title player account ID of the invitor?
We have azure functions with authentication to get to all the api's and I've experimented with pretty much every api out there and cannot find a working path to get the display name. This post is close to the same question. However I cannot find a way to make a get profile call return a result either from an Azure Function or from a client api call in unity. Here's Azure function code:
PlayFab.ProfilesModels.GetEntityProfileRequest profReq = new PlayFab.ProfilesModels.GetEntityProfileRequest();
PlayFab.ProfilesModels.EntityKey theKey = new PlayFab.ProfilesModels.EntityKey();
theKey.Id = idForName; //this is the invitor's title ID received from listener
theKey.Type = "title_player_account";
profReq.Entity = theKey;
PlayFab.ProfilesModels.GetEntityProfileResponse resp = (await PlayFabProfilesAPI.GetProfileAsync(profReq)).Result;
"resp" always comes back null.
I've been scouring posts and api's for about 8 hours and cannot find an answer.
Very frustrating that there's not a straight forward way to get to a players title info, specifically display name, using the players title ID when that's what lobby seems to be based on. Pretty straight forward thing if you have the PlayfabID (master). Not so much if all you have is Title Player ID.
Please help! :)