Now I've tried this 2 different ways. The first was with the IOnlineSessionPtr using "CreateSession" heres the code
FOnlineSessionSettings SessionSettings; SessionSettings.bAllowInvites = true; SessionSettings.bShouldAdvertise = true; SessionSettings.bUsesPresence = true; SessionSettings.bAllowJoinInProgress = true; SessionSettings.NumPublicConnections = 3; SessionSettings.NumPrivateConnections = 0; SessionSettings.bAllowJoinViaPresenceFriendsOnly = true; SessionInterface->CreateSession(0, "PlayFabSession", SessionSettings);
This didn't create a session and it was due to the code failing at a point where the playfab plugin is checking if the ISocketSubsystem is valid which in my case it was NULL. Not sure how to troubleshoot that I tried another way and this was getting the FPlayFabLobbyPtr and calling "CreateLobbyWithUser" Heres the code
if (LobbyConfiguration->CreateLobbyWithUser(MakeShared<FPlayFabUser>(FPlayFabUser(Result.PlayFabId, Result.EntityToken->EntityToken, Result.EntityToken->Entity->Id, Result.EntityToken->Entity->Type, "TestSession", nullptr)), "TestSession", SessionSettings)) { UE_LOG(LogPlayFabSessionsSubsystem, Warning, TEXT("Successfully Created Lobby")); } else { UE_LOG(LogPlayFabSessionsSubsystem, Warning, TEXT("Failed to Create Lobby")); }
Now this actually returned true but I hit a hard crash due to an Exception in the FPlayFabLobby::HandleCreateAndJoinLobbyCompleted Delegate. According to the error the "ExistingNamedSession" was NULL. This caused my game to crash.
Has anyone worked with this and can help me out with the correct way to create lobbies so I can invite friends.