Fans-only content in facebook with asp.net C# sdk

You get signed request when your web page is loaded within facebook canvas app; you should be able to parse signed request something similar to following: if (Request.Params[“signed_request”] != null) { string payload = Request.Params[“signed_request”].Split(‘.’)[1]; var encoding = new UTF8Encoding(); var decodedJson = payload.Replace(“=”, string.Empty).Replace(‘-‘, ‘+’).Replace(‘_’, “https://stackoverflow.com/”); var base64JsonArray = Convert.FromBase64String(decodedJson.PadRight(decodedJson.Length + (4 – decodedJson.Length … Read more

Deserializing JSON when sometimes array and sometimes object

A very detailed explanation on how to handle this case is available at “Using a Custom JsonConverter to fix bad JSON results”. To summarize, you can extend the default JSON.NET converter doing Annotate the property with the issue [JsonConverter(typeof(SingleValueArrayConverter<OrderItem>))] public List<OrderItem> items; Extend the converter to return a list of your desired type even for … Read more