question

wjurica avatar image
wjurica asked

Lack of documentation for "Request Type" in PlayFab settings

In PlayFab Settings, what are the implications of the different options for Request Type (UnityWWW, HTTPWebRequest, UnityWebRequest)? What is the preferred setting and what are the differences?

10 |1200

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

Paul Gilmore avatar image
Paul Gilmore answered

In the past, we have maintained multiple HTTP stacks, because each had separate benefits in different circumstances, and there were sometimes issues with one which were resolved by the other(s).

With Unity 2018.2, Unity has discontinued WWW, in favor of UnityWebRequest, and so we will likely be removing the WWW option for that version. As of 2017.1, WWW was just a wrapper for UnityWebRequest anyways, so that doesn't change anything for you.

Additionally, in Unity 2018.2, Unity has upgraded UnityWebRequest to have some TLS1.2 security upgrades, which do not exist in the other options.

So, TLDR:

You should use UnityWebRequest. We will very likely make that the default sometime soon.

10 |1200

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

Andreas Gullberg Larsen avatar image
Andreas Gullberg Larsen answered

Are there any updates on this?

Is UnityWebRequest still the only alternative to support TLS 1.2, or can I also use UnityHttpRequest?

I'm currently using UnityHttpRequest and get the warning:

PlayFab API calls will likely fail because you have not set up a HttpWebRequest certificate validation mechanism.

Please set a validation callback into PlayFab.Internal.PlayFabWebRequest.CustomCertValidationHook, or set PlayFab.Internal.PlayFabWebRequest.SkipCertificateValidation()

However, from the Editor at least everything seems to work just nice on Unity 2019.1.11f and NET 4.x for both API compatibility and runtime version.

Has TLS 1.2 support been added perhaps? If so, the warning should be removed or maybe clarify what platforms are not supported.

The reason I favor UnityHttpRequest is that it does not require me to call PlayFab SDK from main thread. As an example, I have a leaderboard service that use a .NET timer to poll PlayFab for updated statistics. With UnityWebRequest it throws an exception that I have to run on the main thread.

I could use a MonoBehavior game object and InvokeRepeating to poll the leaderboard service, but I really don't like tying too much logic to the Unity framework if I can help it. Is that how I would have to go about it to when using UnityWebRequest, or is there perhaps a better way?

To recap:

1. Is TLS 1.2 supported on UnityHttpRequest in newer versions of Unity or perhaps for certain platforms/API versions?

2. If UnityWebRequest is still the recommended solution, do I need to use game objects to poll things like leaderboards or can I work on background threads somehow?

Thanks.

10 |1200

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

Teemu Karjalainen avatar image
Teemu Karjalainen answered

would really like a clarification on this

10 |1200

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

Jean-Baptiste Lai avatar image
Jean-Baptiste Lai answered

I would also like a clarification on this. And what is the recommendation.

Also, There is a discrepency between the selected Request Type in the Playfab Extension and in the PlayFabSharedSettings. Selecting one does not match on the other side.
This probably due to the fact the PlayfabSettings.WebRequestType does not match PlayfabEditorSettings.WebRequest Type because of the ifdefs.

10 |1200

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

Resul Volkan Ozcan avatar image
Resul Volkan Ozcan answered
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.