question

jasonbluebox avatar image
jasonbluebox asked

PlayerProfile is null in InfoResultPayload if CreateAccount is true and user is new

When calling any of the Login methods (ie. LoginWithCustomID) with CreateAccount set to true and InfoRequestParameters.GetPlayerProfile set to true and this is the first login for the device the call is successful and returns a valid PlayFabId, SessionTicket, but the result.InfoResultPayload.PlayerProfile is NULL.

If this same code is called but the CustomId is already registered, the PlayerProfile is returned.

I would expect the newly created player profile to be returned when the Login call is used to create the account.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy avatar image
Andy answered

I'm not sure whether this is by design or a bug. I could see an argument for both. I do agree that it would be more convenient if it did return the just-created profile. I'll raise it with the appropriate team and see what they say.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jasonbluebox avatar image jasonbluebox commented ·

Thanks Andy. I looked through the documentation and wasn't able to find anything that would imply the profile shouldn't be returned.

0 Likes 0 ·
sowee avatar image sowee commented ·

Any follow up on this issue?

0 Likes 0 ·
Andy avatar image Andy ♦♦ sowee commented ·

Actually yes. The team decided this is too risky to change (there's an order of operations problem with regard to when the profile actually exists, empty or not). Instead, they're updating the documentation to reflect the current behavior.

1 Like 1 ·
VU VIET DUNG avatar image
VU VIET DUNG answered
//temp fix

 private void OnPlayfabAuthComplete(LoginResult result)
    {
        if (result.InfoResultPayload.PlayerProfile == null)
        {
            //create new account need once more login
            AutoLogin();
            return;
	}

	//abcxyz
    }
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.