There was some caching involved in the http requests, causing some confusion about what exactly caused the issue. Turned out the "User-Agent" header field was also different, and was missing the os information. The User Agent is in the format: string.Format("Zendesk-SDK/{0} {1}/{2} Variant/Unity", this.SDKVersion, this.OsFamily, this.OsVersion) and for OSVersion it takes "SystemInfo.operatingSystem" and removes everything except numbers and ".", which on windows is the windows version number, but on xbox and ps4 devkits that field value doesn't include any numbers resulting in an empty string for OsVersion, and a User-Agent string of "Zendesk-SDK/1.2.5 Unity/ Variant/Unity" which seems to cause the 450 http errror.
I was able to fix the Issue by modifying the ZendeskCore.GetOSVersion() function in UnityDLL.dll of the zendesk sdk:
Changing
if (!string.IsNullOrEmpty(SystemInfo.operatingSystem)) { return Regex.Replace(SystemInfo.operatingSystem, "[^0-9.]", ""); } return "0";
to string text = SystemInfo.operatingSystem; if (!string.IsNullOrEmpty(text)) { text = Regex.Replace(text, "[^0-9.]", ""); } if (string.IsNullOrEmpty(text)) { return "0"; } return text;
I hope this fix can be included in the next sdk update, or help any other dev stumbling over the same Issue.
I'm having the same Issue with Unity sdk version 1.2.5 Strangely it only returns 450 http status on xbox and ps4 devkits but not on pc. Only difference I could see is the locale set in "Accept-Language" header, which was "English" on pc and "en-US" on console.
When testing the init api ({{baseUrl}}/api/private/mobile_sdk/settings/{{AppID}}.json) in Postman I had the same 450 error with en-US as locale, and changing to English made it return 200 and succeed. Although this wasn't consistent and successive calls with en-US did also return 200 (cleared cookies).
On console hard coding locale to "English" also didn't fix it, except for one time while having the debugger connected it worked strangely and returned 200..
Is there anything you could think of that causes this odd behavior?
3 commenti
Daniel I
Update:
I was able to fix the Issue!
There was some caching involved in the http requests, causing some confusion about what exactly caused the issue.
Turned out the "User-Agent" header field was also different, and was missing the os information.
The User Agent is in the format:
string.Format("Zendesk-SDK/{0} {1}/{2} Variant/Unity", this.SDKVersion, this.OsFamily, this.OsVersion)
and for OSVersion it takes "SystemInfo.operatingSystem" and removes everything except numbers and ".", which on windows is the windows version number, but on xbox and ps4 devkits that field value doesn't include any numbers resulting in an empty string for OsVersion, and a User-Agent string of "Zendesk-SDK/1.2.5 Unity/ Variant/Unity" which seems to cause the 450 http errror.
I was able to fix the Issue by modifying the ZendeskCore.GetOSVersion() function in UnityDLL.dll of the zendesk sdk:
Changing
if (!string.IsNullOrEmpty(SystemInfo.operatingSystem))
{
return Regex.Replace(SystemInfo.operatingSystem, "[^0-9.]", "");
}
return "0";
to
string text = SystemInfo.operatingSystem;
if (!string.IsNullOrEmpty(text))
{
text = Regex.Replace(text, "[^0-9.]", "");
}
if (string.IsNullOrEmpty(text))
{
return "0";
}
return text;
I hope this fix can be included in the next sdk update, or help any other dev stumbling over the same Issue.
Kind Regards
0
Daniel I
I'm having the same Issue with Unity sdk version 1.2.5
Strangely it only returns 450 http status on xbox and ps4 devkits but not on pc.
Only difference I could see is the locale set in "Accept-Language" header, which was "English" on pc and "en-US" on console.
When testing the init api ({{baseUrl}}/api/private/mobile_sdk/settings/{{AppID}}.json) in Postman I had the same 450 error with en-US as locale, and changing to English made it return 200 and succeed.
Although this wasn't consistent and successive calls with en-US did also return 200 (cleared cookies).
On console hard coding locale to "English" also didn't fix it, except for one time while having the debugger connected it worked strangely and returned 200..
Is there anything you could think of that causes this odd behavior?
0
Gofran Shakair
Hello Sun,
Can you please share which Unity SDK version you are using?
0
Accedi per lasciare un commento.