![]() An asyncronous request is sent and the result is logged. ![]() That's half the parameters we need to upload an image the other half are the user ID and the access token that allow us to form the correct URL and we have those from the FB initialization so we're good to go. Let's see what happens when we kill the mech! As we've already seen from the engine code part, the UploadImageOnFacebook JS function is called, supplying the image as a byte array and a message. Welcome to the Unity Forums Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively. Now that the user is logged in we can finally post messages and photos on the wall. Forums > Unity Community Discussion > Editor & General Support >. This time the property is greater than zero and the page assumes the user is logged in.Ĭhanging the avatar icon is done by simply subscribing to the " auth.statusChange" event using the Facebook API: Upon successful login, Facebook redirects the page to the same local resource that initiated the request (as we discussed previously in the login flow part). If the user is not authenticated, a button element is appended to the HTML body that leads to the Facebook login dialog. This is done by checking the anchor portion of the page URL - if there is none, we assume the user is not logged in (not the brightest, most secure way of determining that, but it does the job for the sample :)). The first thing that the script does is checking if the user is logged in Facebook. I'll review the initialization and uploading only, but you can check out the whole script here if you're interested. It provides Facebook login functionality and functions for posting messages and photos on your wall. This script does most of the heavy lifting on the JavaScript side.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |