Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to build a Facebook Windows Desktop Application.
Got a Keyboard with an LCD and want to facebook chat messages on it as well as reply to them.
I've been Googling for days but mostly finding outdated components and examples, or examples and code that only apply to Web development instead of Desktop development.
So, if anyone has some experience with this, input would be most welcome.

So far, I got as far as getting a connection up with Facebook, now i want to step forward, but i seem to be hitting a brick wall..
I'm using NuGet module "Facebook C# SDK" Version 6.8.0 (latest): facebook-csharp-sdk: Fa... - GitHub[^]
Here's my Class:
VB.NET
Imports Facebook
Imports System.Dynamic

Public Class Connector
    Public Shared Sub Main()
        test
    End Sub

    Public Shared sub test()
        Dim LoginForm As New frmLogIn("ApplicationID", "user_about_me")
        If (Not LoginForm.ShowDialog = System.Windows.Forms.DialogResult.OK) Then _
            Exit sub

        Dim UserToken = LoginForm.FacebookOAuthResult.AccessToken
        Dim Client As New FacebookClient(UserToken)
        Dim Result As Object = Client.Get("me")
        MsgBox(Result.ToString)

        ' This next part returns error: (OAuthException - #12) (#12) fql is deprecated for versions v2.1 and higher
        ' Turns out Facebook has stopped supporting FQL requests and switched over to Graph API, I'm not finding any solutions online on how to create a non-webbased Facebook Application in DotNet
        Dim query = string.Format("SELECT uid, name, pic_square FROM user WHERE uid = me()")
        Dim Parameters As Object = New ExpandoObject
        Parameters.q = query
        Result = Client.Get("fql", Parameters)
        MsgBox(Result.ToString)
    End sub
End Class


But, at least i can get Connected.. Some help on how get the following would be absolutely awesome:
- Get Friends List (UserID, Username)
- New Message Notification Event (UserID, Username, SentMessageToMeContainingX)
- Send Message to UserID, MessageToSend

Please, don't just refer to Documentation pages, as i have checked them, and they haven't been of much help..
For instance https://developers.facebook.com/docs/[^] doesn't have documentation for Desktop development, mostly Mobile iOS, Android and Webdevelopment. They don't even have an SDK for Desktop development as they are referring to third party tools.
Also the 3d Party SDK Development hasn't been of much help, as these are also all Web Oriented: Facebook SDK for .NET[^]
So, if anyone has any insight on how to get data from an open connection, please shine some light, as google is turning out to be a dark hole
Posted
Comments
Richard MacCutchan 4-Feb-16 7:55am    
The reason they don't have an SDK for desktop development is because they do not expect to support such a feature. However, you could try using one of the HTTP classes that allow you to interact with a website from a desktop app.
Member 12293516 4-Feb-16 8:05am    
Hey, I've thought about using HTTP Classes but i haven't got much experience using these or know how to go about this.
The biggest problem i'm experiencing is that Facebook keep updating and changing their approach and methods, so most of what's out there no longer applies or is just outright discontinued.
As to my last post, I'm now getting out a list of Friends from Facebook and am attempting to Deserialize them using JSon into a List of Friend objects.
Thusfar the examples i've found about this and ways to approach these have not worked..:
Had to add rights: Dim LoginForm As New frmLogIn("AppID", "user_about_me,user_friends")
The well spread way of getting friends that is no longer supported: Result = Client.Get("/me/friends") > as it now only returns a list of friends that have also added this application and granted permissions
The way to actually get a list of friends as of recently: Result = Client.Get("/me/taggable_friends?fields=id,name")
And now i'm trying to Deserialize the output into a List(Of Friend): dim x As List(Of FBFriend) = DirectCast(JsonConvert.DeserializeObject(Result.data.ToString), List(Of FBFriend)) => But this doesn't seem to be working, the proposed solutions online of going about this seem to error out one at a time :x

Dear Richard, if you are able to push me in the direction of how to go about handling Facebook, i'm all ears
I only need 3 things: Get Friends List, Get New Chat Message Event, Send Message
Richard MacCutchan 4-Feb-16 8:10am    
And the answer is in the Facebook documentation.
Member 12293516 4-Feb-16 8:13am    
I've gone through it several times, as it is a good source of finding out what permissions to use, what has changed, etc.
But it's not a good source for finding out how to go about this, as not a single thing there is aimed at Visual Studio, it's all JavaScript
Thats just a dick anwser ...
Richard MacCutchan 4-Feb-16 8:36am    
Well you asked the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900