8

I use Facebook Connect for login on my website and need to create functionality of sending personal messages to user's Facebook friends.

A solution from this question is not suitable for me because I need to send messages to several friends at the same time (user just selects friends from the list who she/he wants to send a message).

I've found pretty good post about this question for Ruby - How to send private messages with Facebook API. But I can't find a C# package similar to xmpp4r_facebook Ruby gem.

agsXMPP SDK and jabber-net don't support X-FACEBOOK-PLATFORM SASL mechanism (http://forum.ag-software.de/thread/1372-Facebook-Chat and Connect to facebook chat using Jabber.net (C#/Mono) with SASL).

I hope to find some existing solution instead of updating one of these libraries. Or to find some library like xmpp4r_facebook but for .NET platform.

Thanks.

Community
  • 1
  • 1
Dmitry Khryukin
  • 6,408
  • 7
  • 36
  • 58

2 Answers2

3

The latest sources of agsXMPP supports the X-FACEBOOK-PLATFORM Sasl mechanism.

1) checkout the latest sources
2) add the following code to the OnSaslStart event

private void XmppCon_OnSaslStart(object sender, SaslEventArgs args)
{
   args.Mechanism = Mechanism.GetMechanismName(agsXMPP.protocol.sasl.MechanismType.X_FACEBOOK_PLATFORM);
   args.ExtentedData = new FacebookExtendedData {AccessToken = "YOUR TOKEN", ApiKey = "YOUR API KEY"};    
}
Alex
  • 4,066
  • 2
  • 19
  • 21
0

Facebook does not allow the SDK to send private messages to prevent misuse by spammers

Mr Shadi
  • 36
  • 2