question

Galatea Interactive avatar image
Galatea Interactive asked

How to Find player Playfab ID using CustomID (GetPlayFabIDsFromGenericIDs)

In my server, I want to find a player playfabId from a customID that I have from a third-party login service.

This is the code for player login in my game

PlayFabClientAPI.LoginWithCustomID(new LoginWithCustomIDRequest()
{
  CustomId = customId,
  CreateAccount = new bool?(true)
}, OnLoginSuccess, OnLoginFailed);

I found about GenericID and I think I can use AddGenericId after the user Login, and then use GetPlayFabIDsFromGenericIDs from my server, but it just give me a result without PlayFab id

{
    "code": 200,
    "status": "OK",
    "data": {
        "Data": [
            {
                "GenericId": {
                    "ServiceName": "SomeServiceName",
                    "UserId": "customId"
                }
            }
        ]
    }
}

In further testing with Postman, the GetPlayFabIDsFromGenericIDs always respond the same as my Post Body.

Is this how GetPlayFabIDsFromGenericIDs should behave?

If that so, how can I retrieve a player PlayFab ID using a CustomId ?

Account 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

·
Seth Du avatar image
Seth Du answered

GenericId is a standalone feature, which is separate from login identity, and has nothing to do with custom ID. It is designed to store the ID from external 3-rd party service.

You may need to call AddGenericID (PlayFab Client) API to add corresponding information, so that they can be found via GetPlayFabIDsFromGenericIDs API call.

The callback result will contain PlayFab Id if the GenericId is valid, and it will be like:

{
    "code": 200,
    "status": "OK",
    "data": {
        "Data": [
            {
                "GenericId": {
                    "ServiceName": "BigBizSocial",
                    "UserId": "test000001"
                },
                "PlayFabId": "xxxxxxxxxx"
            
        ]
    }
}
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.