facebook-c#-sdk

Get Access Token programmatically in Unit Test Method

若如初见. 提交于 2019-12-01 10:13:24
问题 First, I open Facebook Developers page, and I create new App. ( I get AppID, AppSecret values) I want create Unit Test method for do Post to the wall, and later delete the post. publish_stream, publish_actions Manually , I do this 3 steps Open url https://graph.facebook.com/oauth/authorize?client_id=xxxxx&redirect_uri=http://www.kiquenet.com/&scope=publish_stream,publish_actions Then, this url opened, and I get the code value : http://www.kiquenet.com/?code=A....3qhOw#= And then, open this

Facebook C# SDK Get Current User

╄→гoц情女王★ 提交于 2019-12-01 08:45:12
问题 I m working on a Facebook App. Not a website. I am trying to use Facebook C# SDK and trying to get Current User and Query Current User info. How do i do that? Also, When i try to use an app it s asking for Adding the app, requesting permission to access data, how do i do that also? Is there a comprehensive examples of these things? 回答1: If you're stuck working with .NET 3.5, this will work: var facebookClient = new FacebookClient(FacebookAccessToken); var me = facebookClient.Get("me") as

How to call a particular method every some seconds in c#?

穿精又带淫゛_ 提交于 2019-12-01 05:52:05
"Robot Game" is the first basic game I developed. The Magenta '#' character is an enemy and it is supposed have a random movement in this map, but its random movement is too fast and I tried to use Threading but it effects all characters' speed. Now, I need To call the "Enemy" method every 100 milliseconds. Robot game Image: You can use System.Timer . However, be forewarned that these timers might not be as accurate as you may desire. You'll never easily get a fully-accurate timer on a non-realtime OS such as Windows, but if you want better timer accuracy, a Multimedia timer might help. System

How to call versioned graph API services in Facebook .NET SDK?

早过忘川 提交于 2019-12-01 04:26:07
问题 It seems that Facebook now wants us to call versioned endpoints of the Graph API. E.g., https://graph.facebook.com/v2.0/me... Does the Facebook SDK for .NET make versioned calls? Do I/can I do something to specify the version? 回答1: Sanjeev got it, there is a parameter you can add to specify version: FacebookClient fbClient = new FacebookClient(); fbClient.Version = "v2.2"; fbClient.Post("me/feed", new { message = string.Format("Hello version 2.2! - Try #2"), access_token =

How to call a particular method every some seconds in c#?

回眸只為那壹抹淺笑 提交于 2019-12-01 03:46:34
问题 "Robot Game" is the first basic game I developed. The Magenta '#' character is an enemy and it is supposed have a random movement in this map, but its random movement is too fast and I tried to use Threading but it effects all characters' speed. Now, I need To call the "Enemy" method every 100 milliseconds. Robot game Image: 回答1: You can use System.Timer. However, be forewarned that these timers might not be as accurate as you may desire. You'll never easily get a fully-accurate timer on a

Facebook web application extended permissions second step dont show

荒凉一梦 提交于 2019-12-01 03:08:14
Update2 This post is getting old but still relevant.. Below is whe way I solved it. I marked the other guys answer because I think it answers the question better. I'm calling a similar method(I'am about to refactor:)) in accountcontroller. The string should be a list... I think you get it. /// <summary> /// Use this method when an action fails due to lack of priviligies. It will redirect user to facebook with provided permission request. /// Refactor to handle list of request. /// </summary> /// <param name="permission"></param> private static void AddAdditionalPermissions(string permission) {

Does the Facebook .NET client SDK support universal apps / apps generated via AppStudio?

被刻印的时光 ゝ 提交于 2019-12-01 00:30:15
I created a universal app via Microsoft's AppStudio. I tried adding Facebook authentication to the app by following the 'Scrumptious tutorial' ( http://facebooksdk.net/docs/phone/tutorial/ ). When I run the app on my phone, I can never get to the facebook login page, because the following line: await App.FacebookSessionClient.LoginAsync("user_about_me,read_stream"); always results in the following exception: System.NotImplementedException: Not implemented at Windows.Security.Authentication.Web.WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions options, Uri requestUri, Uri

Facebook web application extended permissions second step dont show

戏子无情 提交于 2019-11-30 23:20:01
问题 Update2 This post is getting old but still relevant.. Below is whe way I solved it. I marked the other guys answer because I think it answers the question better. I'm calling a similar method(I'am about to refactor:)) in accountcontroller. The string should be a list... I think you get it. /// <summary> /// Use this method when an action fails due to lack of priviligies. It will redirect user to facebook with provided permission request. /// Refactor to handle list of request. /// </summary>

C#: Anything wrong with setting HttpContext.Current in a parallel thread?

随声附和 提交于 2019-11-30 21:29:31
I'm using a library that relies on HttpContext.Current. The library is Facebook C# SDK, but my question should apply in other scenarios as well. I'd like to use this library from inside of a parallel thread. However, HttpContext.Current is not available in the parallel thread, so I'm thinking about caching it to a local variable and then setting it in the parallel thread like this: var httpContext = HttpContext.Current; Parallel.ForEach(items, item => { try { HttpContext.Current = httpContext; // Call a method that relies on HttpContext.Current } finally { HttpContext.Current = null; } }); Do

Facebook Authentication and strange redirect behaviour

喜夏-厌秋 提交于 2019-11-30 20:07:13
I'm currently testing an OAuth implementation of facebook connect using http://facebooksdk.codeplex.com . I've got a FacebookController with 2 simple actions called LogOn and CallBack . Everything works fine and the user is logged correctly into my system. The problem is when the CallBack action is called, something strange happens that makes a simple return Redirect(loggedUrl); redirecting to the correct logged url but ending with the following characters: #_=_ It appears that the Facebook server sends the information to my webserver using the following HTTP header: HTTP/1.1 302 Found Cache