facebook-c#-sdk

Json structure is returned empty, without property names and values when using Newtonsoft JsonConvert in FB C# client

妖精的绣舞 提交于 2019-12-13 17:22:23
问题 I'm working on asp.net mvc 4 application which uses Facebook C# SDK (6.0.10.0) and Newtonsoft.Json (4.5.0.0). Request with FacebookClient returns expando object: [Authorize] public ActionResult GetFbData(string path = "me"){ var expando = this.fb.Get(path); return Json(expando); } Returned Json looks like: [{"Key":"id","Value":"100000xxxxxxxx"},{"Key":"name","Value":"John Doe"} ... ] I want to return it in format {id:100000xxxxxxx, name:"John Doe", ... } so I added this to the code which

HTTP verb POST used to access path '/' is not allowed in Facebook app

丶灬走出姿态 提交于 2019-12-13 16:08:26
问题 I'm trying to build simple facebook application with 4.2.1 C# SDK. But I have an error: The HTTP verb POST used to access path '/' is not allowed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The HTTP verb POST used to access path '/' is not allowed. Source Error: An unhandled exception was

Configuration Error 'Facebook.FacebookConfigurationSection'

我与影子孤独终老i 提交于 2019-12-13 13:25:34
问题 I created a sample asp.net 4.0 application which includes a Facebook Connect button. I run the website on IIS. The site is working fine. But the application gives me error whenever I deployed it in IIS. After changing all the values, the root cause of the error is by changing the "idle time-out" in the application pool. Here is what I did to reproduce this error: 1.Build the site and let it run through IIS.(In visual studio by changing in the website properties to run in custom webserver). 2

Facebook webforms app get app_data querystring

柔情痞子 提交于 2019-12-13 11:48:56
问题 How do i get app_data querystring from a Facebook webforms app? I want to be able to send some info in the querystring so i can display different home screen on my app. The app is sittin in a page tab. Example: http://www.facebook.com/pages/APPNAME/157772164271503?sk=app_230501256972470&app_data=Page.aspx How do i get "Page.aspx" from app_data? I need it to redirect the user to a different page from Default.aspx I found the solution. Get Querystring from facebook tab app using asp.net using

How to get Number of shares and Likes for a URL using FacebookGraph API

末鹿安然 提交于 2019-12-13 07:25:00
问题 How to get Number of shares and Likes for a URL using Facebook Graph API? There are a few posts answering a similar question but every post offers a different method/fb API. I am using the C# SDK and I guess I should be using the Graph API since FQL is not supported in the latest FB API. This answer looks nice but the poster said the returned value for shares is sum of shares and likes for this URL and I need them separately. 回答1: After Posting post into facebook you will get Post ID

FacebookWebContext.Current.IsAuthenticated() always returns false

。_饼干妹妹 提交于 2019-12-13 05:23:03
问题 I wonder if someone could kindly point me in the right direction. I am using the facebook c# sdk to authenticate the user. I have implemented IFacebookApplication in my global.asax, so at a later date I can programmatically provide the AppId/AppSecret for different facebook apps. Here is my current setup I have this class: public class RequestScopedFacebookApplication : IFacebookApplication { public RequestScopedFacebookApplication() { } public IFacebookApplication Current { get { var url =

Facebook Album Picture using Facebook C# SDK

蹲街弑〆低调 提交于 2019-12-13 03:31:46
问题 I'm tring to get an album picture from facebook using the facebook C# SDK within Silverlight app with the following code: FacebookClient client = new FacebookClient(this.Profile.AccessToken); client.GetAsync(string.Format("/{0}/picture?type=small", this.ID)); client.GetCompleted += (s, e) => { dynamic result = e; }; Where this.ID is the ID of the album, but I get this error: Unexpected character encountered while parsing value: �. Line 1, position 1. from the DeserializeObject method in the

Problem when posting back to mvc 3.0 facebook app

女生的网名这么多〃 提交于 2019-12-13 01:43:58
问题 I have setup a facebook app, configured it to point to my localhost and created a tab in facebook to point to the local app. All works fine and the initial load renders my page fine and the user is authenticated when I check FacebookWebContext.Current.IsAuthenticated(). My problem is that when I post data back, the facebook context is lost and FacebookWebContext.Current.IsAuthenticated() returns false. Not sure if I am missing something here, but surely I should be able to post back to

Message with new line character is displayed as html code

喜欢而已 提交于 2019-12-13 00:38:29
问题 I am using following code to post multiline message on facebook wall/page. but it is appear as shown in image (the text are different here). here is my code. string path = "/me/feed"; string token = fbLoginDialog.FacebookOAuthResult.AccessToken; dynamic messagePost = new ExpandoObject(); messagePost.message = @"Hello guys! How are you? Can you help me on this?"; var fb = new FacebookClient(token); try { var postId = fb.Post(path, messagePost); } catch (Exception ex) { MessageBox.Show(ex

How to post photo to facebook page feed - not posted by others

谁说我不能喝 提交于 2019-12-12 19:25:27
问题 I have installed facebook sdk Now i am able to post to wall like this with below code the code for posting above message FacebookClient myClient = new FacebookClient(srAcceToken); var dicParams = new Dictionary<string, object>(); dicParams["message"] = "trial message"; dicParams["caption"] = string.Empty; dicParams["description"] = string.Empty; dicParams["name"] = "deneme 123"; dicParams["req_perms"] = "publish_stream"; dicParams["scope"] = "publish_stream"; dicParams["access_token"] =