question

kevin-4 avatar image
kevin-4 asked

LastLogin DateTime nullable always null for returning user

I have enabled the 'Last login time' option in Settings -> Client Profile Options in the PlayFab dashboard. However whenever I access the player's last login time via the client (from their GetPlayerCombinedInfoResultPayload.PlayerProfile.LastLogin), the DateTime object never has a value. Is this broken functionality, or is there another setting I need to toggle on?

apisAccount Management
10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Yes, I can see how this could be confusing. The Client Profile Options control the profile data that's returned on leaderboard queries and friend lists. The GetPlayerCombinedInfo call pre-dates the current version of the player profile. I'll file a bug to get the docs updated to reflect this.

4 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.

kevin-4 avatar image kevin-4 commented ·

So what call would I need to make to get the last login value clientside?

I was thinking of serializing my own DateTime object under the user's PlayerData for every game session, but your reply makes it seem like there's an easier way to retrieve LastLogin without extra overhead.

0 Likes 0 ·
brendan avatar image brendan kevin-4 commented ·

Using any call that has ProfileConstraints - so, GetPlayerProfile, GetFriendsList, or any leaderboard query.

0 Likes 0 ·
kevin-4 avatar image kevin-4 brendan commented ·

I understand that apparently GetPlayerCombinedInfo pre-dates the current version of the player profile. But the GetPlayerCombinedInfoResultPayload that it returns nonetheless contains a PlayerProfileModel - the same type that the GetPlayerProfile call you mentioned returns. The docs likewise link to the same page. I believe this counts as a bug and should be fixed so that GetPlayerCombinedInfoResultPayload actually pulls the correct PlayerProfileModel. This will save unnecessary calls to the backend to retrieve data that should already be obtained.

0 Likes 0 ·
Show more comments

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.