So, I created a little mini-project to test using an HttpWebRequest object to make Facebook Graph calls on each of the Unity target platforms. I did this successfully on the following platforms: Editor, OSX Desktop, Windows Desktop, iOS.
However, I ran into a problem when trying a Web Player build. I got the follow exception when I tired to call HttpWebRequest.Create().
System.NotSupportedException: http://graph.facebook.com/4?fields=cover at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000] in :0 at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in :0 at System.Net.WebRequest.Create (System.String requestUriString) [0x00000] in :0 at GraphProof.ExecuteHttpWeb ()[0x00000] in :0
According to Unity Documentation at http://docs.unity3d.com/Documentatio...atibility.html HttpWebRequest should function in the Web Player. Here is a screen capture of the line in question on the MonoCompatibility page: http://s8.postimage.org/yw3tlqitx/Ht...patibility.png.
Is the documentation in error, or could I be doing something wrong (keeping in mind that it worked fine on every other platform I tried).
Update:
Also, not looking for anyone to point me to alternatives, I'm aware of things like the WWW class and UniWeb. The targeting of HttpWebRequest is intentional .
↧