question

nannie avatar image
nannie asked

FailedRequestViewConstraintParamsNotAllowed

I tried to get the verification status on player's contact email but kept getting error as shown below

Request Profile FailedRequestViewConstraintParamsNotAllowed
UnityEngine.Debug:Log(Object)
<>c:<CheckPlayerEmailVerified>b__4_1(PlayFabError) (at Assets/Scripts/PlayFabLogin.cs:88)
PlayFab.Internal.<>c__DisplayClass30_0:<QueueRequestError>b__0() (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:395)
PlayFab.Internal.PlayFabWebRequest:Update() (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:477)
PlayFab.Internal.PlayFabHttp:Update() (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs:364)

Any suggestion? :3

	public bool CheckPlayerEmailVerified(string id)
	{
		bool result = false;
		var request = new GetPlayerProfileRequest()
		{
			PlayFabId = id,
			ProfileConstraints = new PlayerProfileViewConstraints() { ShowContactEmailAddresses = true},
		};


		PlayFabClientAPI.GetPlayerProfile(
			request,
			success =>
			{
				result = success.PlayerProfile.ContactEmailAddresses[0].VerificationStatus == EmailVerificationStatus.Confirmed;
				Debug.Log(success.PlayerProfile.ContactEmailAddresses[0].VerificationStatus);
			},
			fail =>
			{
				Debug.Log($"Request Profile Failed{fail.Error}");
			}
		);


		return result;
	}

10 |1200

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

Seth Du avatar image
Seth Du answered

I have tested your codes on my title and it works fine for me, hence it is a title-specific issue. I think it should be caused by Client Profile Options configuration. Please navigate to [Game Manager] -> [Title Settings] -> [Client Profile Options] and check “Contact email Address” option so that this profile can be accessed by client API via Profile Constraints.

In addition, please note that if your code runs for a player without a contact email, there will be error reported. I will suggest adding try-catch sentences to handle this exception.

10 |1200

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

nannie avatar image
nannie answered

Thank you so much, it works now!

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.