question

ebrahimB avatar image
ebrahimB asked

Accessing user data from another title

I'm having a bit of an issue figuring out how the data system works. I am creating a game (G1) with collectible characters. Right now I am storing that data in the Player Title Data. I want to access that data in another game (G2), but I won't need that data in any other game. I know that publisher data exists across all games but I'd like to avoid using that as it seems like it is meant for global data that will be used across ALL titles and not just some of them. So my question is, is there a way for a player in G2 to access their data in G1?

Player DataTitle Data
10 |1200

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

brendan avatar image
brendan answered

Actually, that's specifically what User Publisher Data (and the read only/internal versions) is designed for. Data that's meant to be shared across titles in your Publisher ID space should be written to one of those data types.

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

ebrahimB avatar image ebrahimB commented ·

I have been working on the implementation of this but I am still confused as to how the data is accessed between the games. I have an account in each game with different CusomId's but the same iOS Device ID. I am storing the data in the player publisher data section of G1. I am trying to access that data in G2, but I don't see anything in the online portal. Is there something I need to do to see the data in the player publisher data section of G2?

0 Likes 0 ·
ebrahimB avatar image ebrahimB commented ·

I guess my expectation is that as soon as I link accounts that the player publisher data is shared between them. Is that not the case?

0 Likes 0 ·
brendan avatar image brendan ebrahimB commented ·

Can you give us the specific Title IDs and player PlayFab IDs, so that we can have a look?

0 Likes 0 ·
ebrahimB avatar image ebrahimB brendan commented ·

Sure!

Title ID for G1: 28D3

for G2: F1AF

Player ID in G1: ADE591568AEE72CE

Player ID in G2: 3D0BD355BD5D677A

0 Likes 0 ·
Show more comments
Show more comments
ebrahimB avatar image
ebrahimB answered

Hey Brendan,

So I am working on the method you described in the comments above but am running into a problem. I keep getting the following error:

The URL for this request is not valid for this title. The correct API endpoint is https://28d3.playfabapi.com

when I test out that method.

Here is the code I am using in unity:

LoginWithIOSDeviceIDRequest requestLogin = new LoginWithIOSDeviceIDRequest() {
     TitleId = "28D3",
     DeviceId = "rioneye"//this is a test
};
PlayFabClientAPI.LoginWithIOSDeviceID(requestLogin,
     (result) => {
         //If there was an account then grab the data
         GetUserDataRequest requestData = new GetUserDataRequest() {
             PlayFabId = result.PlayFabId
         };
         PlayFabClientAPI.GetUserPublisherData(requestData, (dataResult) => {

               //GRAB THE PUBLISHER DATA HERE!!!

               //Reset the login back to the main account
               LoginWithCustomIDRequest requestLogin2 = new LoginWithCustomIDRequest() {
                    TitleId = GameConstants.PLAYFAB_TITLE,
                    CustomId = SystemInfo.deviceUniqueIdentifier
               };
               PlayFabClientAPI.LoginWithCustomID(requestLogin2, null, null);
      }, null);

I login to the new account, I attempt to grab the publisher data from that account, but encounter an error.

10 |1200

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

brendan avatar image
brendan answered

The problem is that if you're using the built-in API calls in our SDK, the URL for the call is being composed with the Title ID you have set in the TitleSettings. So to do this, you would need to change that setting on the fly as you switch from title to title.

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.