Can anyone show what I’m doing wrong? I’m trying to do a simple anonymous signup, then cloud save an item. First I initialize the services, then create a GameClient, use it to sign up anonymously, then call cloud save with its idToken. Maybe there is some intermediate step I’m missing, but using:
AuthenticationService.Instance.SignInAnonymouslyAsync();
CloudSaveService.Instance.Data.Player.SaveAsync()
does work with what seems like the same fundamental steps
UnityServices.InitializeAsync();
var gameClient = ApiService.CreateGameClient();
var signUpRequest = await gameClient.PlayerAuthentication.SignUpAnonymously(Application.cloudProjectId);
signUpRequest.EnsureSuccessful();
// Save an item
var saveResult = await gameClient.CloudSaveData.SetItem(
Application.cloudProjectId,
signUpRequest.Data.UserId,
new Unity.Services.Apis.CloudSave.SetItemBody("testKey", "testValue")
);
saveResult.EnsureSuccessful();