private void secondColumnButtonsGUI() { if (GUILayout.Button("Post Image")) { var pathToImage = Application.persistentDataPath + "/" + FacebookComboUI.screenshotFilename; if (!System.IO.File.Exists(pathToImage)) { Debug.LogError("there is no screenshot avaialable at path: " + pathToImage); return; } var bytes = System.IO.File.ReadAllBytes(pathToImage); Facebook.instance.postImage(bytes, "im an image posted from iOS", completionHandler); } if (GUILayout.Button("Post Message")) { Facebook.instance.postMessage("im posting this from Unity: " + Time.deltaTime, completionHandler); } if (GUILayout.Button("Post Message & Extras")) { Facebook.instance.postMessageWithLinkAndLinkToImage("link post from Unity: " + Time.deltaTime, "http://prime31.com", "Prime31 Studios", "http://prime31.com/assets/images/prime31logo.png", "Prime31 Logo", completionHandler); } if (GUILayout.Button("Post Score")) { // note that posting a score requires publish_actions permissions! Facebook.instance.postScore(5688, (didPost) => { Debug.Log("score did post: " + didPost); }); } if (GUILayout.Button("Show stream.publish Dialog")) { // parameters are optional. See Facebook's documentation for all the dialogs and paramters that they support var parameters = new Dictionary <string, string> { { "link", "http://prime31.com" }, { "name", "link name goes here" }, { "picture", "http://prime31.com/assets/images/prime31logo.png" }, { "caption", "the caption for the image is here" } }; FacebookCombo.showDialog("stream.publish", parameters); } if (GUILayout.Button("Get Friends")) { Facebook.instance.getFriends((error, friends) => { if (error != null) { Debug.LogError("error fetching friends: " + error); return; } Debug.Log(friends); }); } if (GUILayout.Button("Graph Request (me)")) { Facebook.instance.getMe((error, result) => { // if we have an error we dont proceed any further if (error != null) { return; } if (result == null) { return; } // grab the userId and persist it for later use _userId = result.id; Debug.Log("me Graph Request finished: "); Debug.Log(result); }); } if (_userId != null) { if (GUILayout.Button("Show Profile Image")) { Facebook.instance.fetchProfileImageForUserId(_userId, (tex) => { if (tex != null) { cube.renderer.material.mainTexture = tex; } }); } } else { GUILayout.Label("Call the me Graph request to show user specific buttons"); } }