We have a game on Unity 2019.1.10f and have a problem. When we try to buy any pack in our game (on iOS platform) can be two ways: we can’t buy the pack or we can get an endless loader. When we get the first way, what we do:
- We took the receipt from Apple, sent it on our server through the native library UnityWebRequest and we saw, that the receipt, what we got before UnityWebRequest and after (in Charles) are different. It seems like the library changed our receipt, which we tried to send on our server for validation.
- We take the receipt from Apple, try to send it on our server and UnityWebRequest can’t send it. We don’t see any requests on our server and in Charles.
Who has this problem and how we can fix it?
1 Like
Can you show the code? How are you using UnityWebRequest?
I had the the same issue, Please help me to solve the issue.
Here is my code:
private IEnumerator ProcessRequest(string UrlString){
UnityWebRequest www = new UnityWebRequest(UrlString, UnityWebRequest.kHttpVerbPOST);
www.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(JsonData));
www.downloadHandler = new DownloadHandlerBuffer();
www.SetRequestHeader(“Content-Type”, “application/json”);
www.timeout = 60;
yield return www.SendWebRequest();
if (www.isDone)
{
//Success statement
}
}
isDone does not mean UWR succeeded, it means it is completed and it will always be true in this code, since yield return guarantees the completeness.
Thanks for your update. Yes, you are right. But my issue is the receipt which, i sent to server from unity gets modified on receiving in server side. So the receipt got invalid on checking with apple.