Closed hems closed 9 years ago
This other C# FB api does something similar, though it has comments suggesting that this should be optional.
The comments there are of interest:
// Send analytics to Facebook
//** This should be optional as it affects the privacy status of any app consumingthis framework
public class FacebookSessionClient
{
public string AppId { get; set; }
public bool LoginInProgress { get; set; }
public FacebookSession CurrentSession { get; private set; }
public FacebookSessionClient(string appId)
{
if (String.IsNullOrEmpty(appId))
{
throw new ArgumentNullException("appId");
}
this.AppId = appId;
// Send analytics to Facebook
//** This should be optional as it affects the privacy status of any app consumingthis framework
SendAnalytics(appId);
}
private static bool AnalyticsSent = false;
private void SendAnalytics(string FacebookAppId = null)
{
try
{
if (!AnalyticsSent)
{
AnalyticsSent = true;
#if !(WINDOWS_PHONE)
Version assemblyVersion = typeof(FacebookSessionClient).GetTypeInfo().Assembly.GetName().Version;
#else
string assemblyVersion = Assembly.GetExecutingAssembly().FullName.Split(',')[1].Split('=')[1];
#endif
string instrumentationURL = String.Format("https://www.facebook.com/impression.php/?plugin=featured_resources&payload=%7B%22resource%22%3A%22microsoft_csharpsdk%22%2C%22appid%22%3A%22{0}%22%2C%22version%22%3A%22{1}%22%7D",
FacebookAppId == null ? String.Empty : FacebookAppId, assemblyVersion);
HttpHelper helper = new HttpHelper(instrumentationURL);
// setup the read completed event handler to dispose of the stream once the results are back
helper.OpenReadCompleted += (o, e) => { if (e.Error == null) using (var stream = e.Result) { }; };
helper.OpenReadAsync();
}
}
catch { } //ignore all errors
}
Well the description of this project says:
Modeled from the (Facebook Javascript SDK), now with the facebook-node-sdk you can now easily write the same code and share between your server (nodejs) and the client (Facebook Javascript SDK).
I think he's just trying to be feature complete :)
okie dokie.
thanks for the info guys.
I just found out that when using this library there is a funny function call, which sends the appId to a page on facebook.
What is it for ? seems like it is unnecessary for the library to work, specially when the response is completely ignored.
https://github.com/Thuzi/facebook-node-sdk/blob/master/fb.js#L635-L663