Here is my code:
public class PlayFabLogin : MonoBehaviour { public void Start() { var request = new LoginWithIOSDeviceIDRequest { TitleId = "726", DeviceId = SystemInfo.deviceUniqueIdentifier, CreateAccount = true }; PlayFabClientAPI.LoginWithIOSDeviceID(request, OnLoginSuccess, OnLoginFailure); } private void OnLoginSuccess(LoginResult result) { Debug.Log("Congratulations, you made your first successful API call!"); if(PlayerPrefs.HasKey("firstLogin")==false) { //load //PlayerPrefs.SetInt("firstLogin", 1); } } private void OnLoginFailure(PlayFabError error) { Debug.LogWarning("Something went wrong with your first API call. :("); Debug.LogError("Here's some debug information:"); Debug.LogError(error.GenerateErrorReport()); } void LogSuccess(PlayFabResultCommon result) { var requestName = result.Request.GetType().Name; Debug.Log(requestName + " successful"); } void LogFailure(PlayFabError error) { Debug.LogError(error.GenerateErrorReport()); } void GetInventory() { PlayFabClientAPI.GetUserInventory(new GetUserInventoryRequest(), LogSuccess, LogFailure); } }