My question is: How can I hide posts and comments using Facebook SDK in C# ?
and I tried this:
var client = new FacebookClient(access_token);
client.Delete("postId/hidden");
client.Post("postId/hidden");
or:
client.Delete("postId", new { is_visible = true });
client.Post("postId", new { is_visible = true });
but both of them don't work.
Thanks.
At the moment, the Facebook API only allows to delete/hide the user's posts not friends nor other feeds
Related
C# package used: Google.Apis.Calendar.v3
I am making a sharing a calendar to an not google account.
No invite notification sent to that account event the Response = OK
var rule = new AclRule
{
Role = "owner",
Scope = new AclRule.ScopeData
{
Value = acb#yahoo.com,
Type = "user"
}
};
var service = await GetCalendarService();
var request = service.Acl.Insert(rule, calendarId);
request.SendNotifications = true;
AclRule addedRule = await request.ExecuteAsync();
So could anybody help me about that?
Thanks,
I found that google calendar API dont have any options to send notification to non google email.
Moreover, the calendar must be made as public first. This one can not modify by API. And I dont want to make it as public also.
Here's document from google
I have created webapp in .Net MVC which shares post on Facebook. Here is the code of sharing post
var fb = new FacebookClient(facebookAccessToken);
var argList = new Dictionary<string, object>();
argList["name"] = postName;
argList.Add("picture", postImageUrl);
argList["link"] = postUrl;
var actions = new[] { new { name = "More Details", link = morePostDetailsUrl } }.ToList();
argList["actions"] = JsonConvert.SerializeObject(actions);
var postResult = fb.Post("<facebookuserId>/feed", argList);
Now i am able to post this feed successfully but these posts are not being displayed on timeline. I have checked all permission & they are set to public. Also i can see them in activity logs & on Home screen when i logs in.
How to post a feed so that it can be displayed on timeline automatically ?
Also i am using actions, are these actions being deprecated or do i need to submit them for review before going live ?
Please guide me if anyone has some idea on the above.
Thanks
I use the PayPal Express Checkout SOAP service. For example here's a trimmed down version of the code to redirect the user to PayPal Sandbox when checking out:
var client = new PayPalAPIAAInterfaceClient();
var credentials = new CustomSecurityHeaderType() {
Credentials = new UserIdPasswordType() { ... }
};
var paymentDetails = new PaymentDetailsType() {
OrderTotal = new BasicAmountType() {
Value = string.Format("{0:0.00}", 100m)
}
};
var request = new SetExpressCheckoutReq() {
SetExpressCheckoutRequest = new SetExpressCheckoutRequestType() {
SetExpressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType() {
PaymentDetails = new PaymentDetailsType[] { paymentDetails },
CancelURL = "http://www.mysite.com" + Url.Action("Cancelled", "PayPalCheckout"),
ReturnURL = "http://www.mysite.com" + Url.Action("Index", "PayPalCheckout")
},
Version = "60.0"
}
};
var response = client.SetExpressCheckout(ref credentials, request);
return Redirect(string.Format("{0}?cmd=_express-checkout&token={1}", "https://www.sandbox.paypal.com/cgi-bin/webscr", response.Token));
I then handle the data when the user is returned to the ReturnUrl. This was taken from some code I found on another website.
I now need to add a refund facility to my site. I was wondering if anyone else has done this? I've tried searching online but can't seem to find anything that helps. I also tried doing it myself but the API isn't very intuitive.
I'd appreciate the help. Thanks
It would just need to be a RefundTransaction API call that you would need to execute. Are you trying to have your return page issue a refund based on a condition, or are you trying to create a GUI type of interface to allow someone to issue a refund for a transaction? Have you looked at the code samples for this within the SDK's that PayPal offers? You should be able to use this code.
public Form1()
{
InitializeComponent();
// The application key of the Facebook application used
fbService.ApplicationKey = "XXXXXXXXXXX";
// Add all needed permissions
List<Enums.ExtendedPermissions> perms = new List<Enums.ExtendedPermissions>
{
Enums.ExtendedPermissions.none
};
fbService.ConnectToFacebook(perms); //error here (The given key was not present in the dictionary.)
}
I mention the error where I get the error , as am new to facebook api and specially new to c# any explained answer is appriciated
Thank you
Use the static method on FacebookClient like this:
FacebookClient.SetDefaultHttpWebRequestFactory(uri => {
var request = new HttpWebRequestWrapper((HttpWebRequest)WebRequest.Create(uri));
request.Proxy = ......; // normal .net IWebProxy
return request;
});
See this answer also: Facebook SDK Proxy setting C#
Getting familiar with Metro apps so I thought I would try my hand at some twitter stuff. The following code doesn't work.
public static async Task<IEnumerable<TwitterItem>> Search(string term)
{
var search = new SyndicationClient();
var searchUri = new Uri("http://search.twitter.com/search.atom?q=" + term);
//var searchUri = new Uri("http://windowsteamblog.com/windows/b/developers/atom.aspx");
var results = await search.RetrieveFeedAsync(searchUri);
return from item in results.Items
select new TwitterItem
{
Text = item.Title.Text,
CreatedAt = item.PublishedDate.DateTime,
FromUser = item.Authors[0].Name
};
}
It works if I use the windows team blog url but not the twitter url. No exceptions, it just never comes back. Tried to use fiddler but it does not intercept Metro traffic for some reason. Any thoughts?
I agree with #Jon.
Please debug this code with Fiddler to ensure that you're not producing a malformed url.
Please see this answer for more information about using Fiddler with a Metro app.