void RequestsToMany() { var gift = new JsonObject(); gift.Add("social_karma", new JsonPrimitive(5)); gift.Add("badge_of_awesomeness", new JsonPrimitive(1)); var parameters = NSMutableDictionary.FromObjectsAndKeys( new object [] { "Learn how to make your iOS apps social", "Check this out", gift.ToString() }, new object [] { "message", "notification_text", "data" }); _requestDialogHandler = DialogCallback(RequestsCallback); facebook.Dialog("apprequests", parameters, _requestDialogHandler); }
void RequestsToMany() { var gift = new JsonObject (); gift.Add ("social_karma", new JsonPrimitive (5)); gift.Add ("badge_of_awesomeness", new JsonPrimitive (1)); var parameters = NSMutableDictionary.FromObjectsAndKeys ( new object [] { "Learn how to make your iOS apps social", "Check this out", gift.ToString () }, new object [] { "message", "notification_text", "data" }); _requestDialogHandler = DialogCallback (RequestsCallback); facebook.Dialog ("apprequests", parameters, _requestDialogHandler); }
/** For later public Section FacebookConfig (UILabel label) { Section facebookConfig = new Section(label); if (this._facebook.IsSessionValid) { facebookConfig.Add(new StringElement ("Uninstall app", this.UninstallFromFacebook)); } else { facebookConfig.Add(new StringElement ("Login to Facebook", this.Login)); } return facebookConfig; } **/ public void PostToWall(string wallPost) { Console.WriteLine("post to wall launched"); var json = new JsonObject (); json.Add ("name", new JsonPrimitive ("About One RM Log")); json.Add ("link", new JsonPrimitive ("http://pennyfarthingapps.com")); // TODO: update with one rm website // TODO: update the picture and URL for the facebook wall post var parameters = NSMutableDictionary.FromObjectsAndKeys ( new object [] { "Hit a new one rep max", "one rm log app", "I just got a new one rep max " + this.SocialMessage, "http://pennyfarthingapps.com", "http://www.wodti.me/img/facebook_icon_large.png", json.ToString ()}, new object [] { "name", "caption", "description", "link", "picture", "actions"}); _wallDialogHandler = DialogCallback (url => { if (url.Query == null) return; var pars = System.Web.HttpUtility.ParseQueryString (url.Query); if (pars ["post_id"] != null) ShowMessage ("Success", "Posted to your wall"); }); this._facebook.Dialog ("feed", parameters, _wallDialogHandler); }
void PostUserWall() { var json = new JsonObject (); json.Add ("name", new JsonPrimitive ("Getting started")); json.Add ("link", new JsonPrimitive ("http://github.com/mono/monotouch-bindings")); var parameters = NSMutableDictionary.FromObjectsAndKeys ( new object [] { "Test using MonoTouch/Facebook", "Hackbook for MonoTouch/iOS", "Some long boring text goes here", "http://xamarin.com", "http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png", json.ToString ()}, new object [] { "name", "caption", "description", "link", "picture", "actions"}); _wallDialogHandler = DialogCallback (url => { if (url.Query == null) return; var pars = System.Web.HttpUtility.ParseQueryString (url.Query); if (pars ["post_id"] != null) ShowMessage ("Success", "Got the message posted, id=" + pars ["post_id"]); }); facebook.Dialog ("feed", parameters, _wallDialogHandler); }