Hello guys,
I'm facing an issue I can't solve in a way that suits me. Here are the details: - We have multiple titles (used as multiple environments, i.e. dev/staging/live etc...) - Let's say for this example that we have Dev and Main title (resp. 0DEV and 1MAI title IDs) - When a player creates an account from our build, it will be created on Main (in my case this is done daily by QAs f.e.) - We have some automated process to write some UserPublisherInternalData for those created account - Process is: get PlayFabId from Email (PlayFabAdminAPI.GetUserAccountInfo), then use that PF ID for PlayFabAdminAPI.UpdateUserPublisherInternalData)
My problem is that I can update user internal pub data using Main TitleID and Secret, but it doesn't work if I try to do it using Dev endpoints
It baffles me, as what I wanna retrieve is the "Master player account ID", which is common to both titles... What I observed is that if the account log in Dev once, I can then use Dev title to update its data. The error being quite explicit ("Title not activated"), I tried using the "IgnoreMissingTitleActivation" but then it just fails with a "User not found" error.
Example code:
from playfab import PlayFabAdminAPI, PlayFabSettings, PlayFabErrors
PlayfabDeveloperSecretKeyEnvVarName = "PlayfabDeveloperSecretKey"
PlayFabSettings.TitleId = "0DEV" #or 1MAI for Main env
PlayFabSettings.DeveloperSecretKey = "whatever"
email = "simon@darewise.com" #account created and logged only in Main
print(f"Fetching {email} account")
request = {"Email": email} #Can use "IgnoreMissingTitleActivation": True
PlayFabAdminAPI.GetUserAccountInfo(request, onUserInfo)
def onUserInfo(success, failure):
if success is None:
print(f"Failed to retrieve account: {failure['errorMessage']}")
else:
playfabId = success["UserInfo"]["PlayFabId"]
payload = "Some internal pub user data"
request = {"PlayFabId": playfabId, "Data": {"my_data": payload}}
PlayFabAdminAPI.UpdateUserPublisherInternalData(request, another_callback)
def another_callback:
print("done")
So basically: how can I get this working? Am I mis-using the IgnoreMissingTitleActivation flag? Is there a "Master API" that would not require my user to log once in each title to be able to handle it from any of them?
Thanks for your help, it drives me crazy as I spent a lot of time reading doc and code examples but could not find any solution.