0

I'm trying to use the Parse Unity plugin, and I am having tons of issues with getting information to and from Parse via a WebGL build. I incorporated the REST-API fixes mentioned here, and this makes it so that Parse will actually hear my requests and usually respond. It doesn't stop Parse from failing at things that look like they should work.

I went exactly by the Parse Unity guide to set everything up. And everything I've been trying to do works perfectly in the editor. The issues only arise when I actually make a WebGL build.

Here are the issues:

  • (Not an issue) LogInAsync seems to work just fine, which confounds me.
  • (An issue I fixed) SignUpAsync would receive a POST 400 Bad Request error. I was able to fix this by signing the user up in Cloud Code and then logging in the user on the client-side when it gets the response from the Cloud Code.
  • (An issue I fixed) Changing the email of the user (using Parse Unity's SaveAsync) would receive a POST 400 Bad Request error. I was able to fix this by sending a request to CloudCode and having some code to set the new email and save the user. And this works now.
  • Changing the password of the user, if I was using Parse Unity's SaveAsync, would receive a POST 400 Bad Request error. I've changed it to do something similar to my email-changer in CloudCode, but that ends up showing a success in the Unity Editor (but the new password doesn't actually work) and it still gives the same error message in WebGL. I tried using request.user and Parse.User.current() and both of those just make it fail (even in the Editor). I have more about that specific issue here, but I feel like that single issue is part of this greater issue.
  • Logging out with LogOutAsync always returns a POST 400 Bad Request error.
  • When I save a ParseFile via file.SaveAsync(), the task never completes (it does complete successfully in the Editor). I can confirm that the post does go through by looking at the networking debug tools in the browsers. This is very strange, and I receive no messages whatsoever. It just...stops. I'd try a CloudCode solution, but I don't think I can actually upload files that way.

I feel like all of these issues are probably related, but I don't know enough about networking and servers to really know why any of this would be happening. I do know that our server has all the required headers, and putting those in allowed me to even get to this point.

I don't know if this is an issue with the Parse Server, with WebGL, with the Parse Unity plugin, with my server, or my own code. The very fact that it works in the Unity Editor when I'm playing by the book shows me that I definitely did most, if not all of it right. I am very surprised that it's not working when I build to WebGL.

Does anyone have any suggestions that I can try? I can't be far off, and I can't be the only one experiencing this issue...can I?

Community
  • 1
  • 1

1 Answers1

1

The Parse Unity3d plugin does not support WebGL as you found in that forum link. So if you are using the REST-API then remove the Parse UnitySDK from your project and just communicate through REST. It sounds as though you are trying to use both but the Parse Unity3D SDK will not work in webgl and thus you need to ditch it.

ickydime
  • 1,051
  • 10
  • 22