just updated unity 2017.1 and all i am getting is this error when making an api call
UriFormatException: Invalid URI: The hostname could not be parsed. (.playfabapi.com) System.Uri.Parse (UriKind kind, System.String uriString) System.Uri.ParseUri (UriKind kind) System.Uri..ctor (System.String uriString, Boolean dontEscape) System.Uri..ctor (System.String uriString) System.Net.WebRequest.Create (System.String requestUriString) PlayFab.Internal.PlayFabWebRequest.Post (PlayFab.Internal.CallRequestContainer reqContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:178) Rethrow as Exception: Unhandled exception in Post : https://.playfabapi.com/Client/LoginWithCustomID UnityEngine.Debug:LogException(Exception) PlayFab.Internal.PlayFabWebRequest:Post(CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:218) PlayFab.Internal.PlayFabWebRequest:WorkerThreadMainLoop() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:131)
,Just updated to unity 2017 and everything gone nuts.
All my api calls are returning this error.
UriFormatException: Invalid URI: The hostname could not be parsed. (.playfabapi.com) System.Uri.Parse (UriKind kind, System.String uriString) System.Uri.ParseUri (UriKind kind) System.Uri..ctor (System.String uriString, Boolean dontEscape) System.Uri..ctor (System.String uriString) System.Net.WebRequest.Create (System.String requestUriString) PlayFab.Internal.PlayFabWebRequest.Post (PlayFab.Internal.CallRequestContainer reqContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:178) Rethrow as Exception: Unhandled exception in Post : https://.playfabapi.com/Client/LoginWithCustomID UnityEngine.Debug:LogException(Exception) PlayFab.Internal.PlayFabWebRequest:Post(CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:218) PlayFab.Internal.PlayFabWebRequest:WorkerThreadMainLoop() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWebRequest.cs:131)
Answer by Brendan · Jul 13, 2017 at 09:21 AM
The most common cause of this is not having the Title ID set correctly in the build. The URL endpoint for any call to PlayFab will always be https:{TitleID}.playfabapi.com/... (with the client, server, matchmaker, or admin api reference to follow).
Answer by Robert · Jul 22, 2017 at 05:06 AM
I came across the exact same error today after upgrading to Unity 2017.1.0f3, even though I hadn't touched the code. Anytime the SDK updates or in this case, Unity has an update, you'll have to go into the PlayFab settings. I figured where else would it store that info, in my case using the Editor Extension, and noticed that in the Settings tab the Studio had defaulted back to the _Override_ setting. So even if the Title ID is set correctly in the code, as @Brendan said it's the build itself, PlayFab's settings.