question

Muhammad Roshaan Tariq avatar image
Muhammad Roshaan Tariq asked

Access Title Data without User Login

Hi,

I have stored some important data in Title Data and I want all of my users to be able to access that data as soon as they open the app even if they are not Logged-in and the chances are they will not be Logged-in.

Can I access it and Is it possible on Playfab?

Title Datadata
10 |1200

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

Muhammad Roshaan Tariq avatar image
Muhammad Roshaan Tariq answered

@Citrus Yan Well if the players must be logged-in I think a silent login would do the task for me in this matter without my players knowing.


The next question arises is that how will I log them out of the silent login I did in the background? Because I would like them to use the Email/Password login they created. Is there any function to delete their credentials?

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

Citrus Yan avatar image Citrus Yan commented ·

Hi @Muhammad Roshaan Tariq,

It's easy, if you are using Unity SDK, simply call PlayFabClientAPI.ForgetAllCredentials() will do the work. What it does is the following:

public void ForgetAllCredentials()
        {
            PlayFabId = null;
#if !DISABLE_PLAYFABCLIENT_API
            ClientSessionTicket = null;
#endif
#if !DISABLE_PLAYFABENTITY_API
            EntityToken = null;
            EntityId = null;
            EntityType = null;
#endif
        }
    }

After that, the players won't be able to make the next API calls unless they log in again. If you are using other SDKs, you can first check if they contain this method, or else you can write it manually.

0 Likes 0 ·
Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq commented ·

Thank you @Citrus Yan

0 Likes 0 ·
Citrus Yan avatar image
Citrus Yan answered

Hi @Muhammad Roshaan Tariq,

>>Can I access it and Is it possible on Playfab?

No, you cannot access it under normal circumstances since it requires credentials retrieved after a player logs in. You may use Admin/GetTitleData or Server/GetTitleData to access it from the client, however, it’s highly un-recommended since it will expose your secret key to the clients.

10 |1200

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