How to Get users header pictures (or cover picture), also known as banner? - tweetinvi

I'm using Tweetinvi API to get access to Twitter's API. What I want is to get the cover picture(or header picture or banner) using the API. So I tried
var twitterCredentials = new TwitterCredentials(consumerKey, consumerSecret, accessToken, accessTokenSecret);
Tweetinvi.Auth.SetCredentials(twitterCredentials);
_userProfile = Tweetinvi.User.GetAuthenticatedUser();
The Method to get the banner is(so I think):
_userProfile.ProfileBannerURL
but It is returning the background image that I used on Twitter not the header(or cover) picture.
Any Ideas please?

To answer my question. For those of you who countered this bug you are probably using the oldest version 0.9.13 or lower like I was doing. Update the API to version 1.0 or higher.

Related

Can't display Facebook user avatar with Facebook API and Graph

I'm working in a React-Native app, and I'm also allowing users to login using FBSDK.
There seems to be an issue at the moment when trying to get the profile picture URL.
There are also several reports of this, like this one but still, after a year doesn't seem to be solved.
Attempted many ways but none worked, it always tries to download the file, seems it's missing the mime-type according to what the browser says.
The URL it gives is the following:
https://platform-lookaside.fbsbx.com/platform/profilepic/?asid={{myfbid}}&height=50&width=50&ext=1583348357&hash=AeTnFpMVwBXgFy_J
Also tried using the graph url directly: http://graph.facebook.com/{myid}/picture
And if I add the &redirect=false, it returns a data object with the platform-lookaside URL.
Everything I try, it tries to download.
This is how I'm currently trying to get the image using Graph API.
new GraphRequestManager().addRequest(new GraphRequest(
'/me',
{
accessToken: fbToken,
parameters: {
fields: {
string: 'picture.type(large)'
}
}
},
graphRequestCallback
)).start();
It works, but the URL is the same.
Any idea on how can I solve this? I might be missing something or the bug is still happening?
If you just change the graph url (http://graph.facebook.com/{myid}/picture) from http to https, it should work for you. Not sure if that's a new fix in React Native or not, but that solved it for me.

Facebook, post to wall, using me/photos, in 2.1 Facebook?

Considering a Unity project from ~3 years ago, and using Facebook graph I'm pretty sure it was 1.0,
You could post to a user's wall like this:
private byte[] imageAsBytes;
Texture2D im = ... your image
imageAsBytes = im.EncodeToPNG();
Dictionary<string, object> dct = new Dictionary<string, object>
{
{ "message", "Marketing message here" },
{ "picture", imageAsBytes }
};
Facebook.instance.graphRequest(
"me/photos", HTTPVerb.POST, dct, completionHandler );
As has been made known for many months now, there is a change to this coming.
With Facebook 2.1 being required as of this Aug 8, I'm rather confused about, simply, whether this still works in 2.1?
in short, how to post an image to the user's wall, in 2.1?
Note - here's where to find the important resource CBRoe mentions below...
Note that the only problem with the alternative, FB.FeedShare() is that, as far as I understand, you can not actually post an image (sure, you can link to an image at a URL).
This isn’t deprecated in any way. But since API v2.0 you need to get the necessary permission reviewed and approved by Facebook, before you can ask normal users for it.
And yes, this is a rather major change - but that's why it was announced way ahead of time, via a lot of channels. We all know how fast the IT world moves and changes- so I think you can not put the blame on Facebook here. If you were "out of the game" (this particular one) for over three years, you just have to go and find the resources that a) list what's changed, and b) what the current state of things is. And the developer section does both. The changelog has already been mentioned, and for example the need to get permissions reviewed now is also mentioned on the starting page for Facebook login, right at the top under Essential Guides.
Plus, Facebook actively informs you about changes - if you let them. Go to https://developers.facebook.com/settings/developer/contact/ where you'll find several options to get informed about specific stuff via e-mail.
You can check the changelog to see what changes happened https://developers.facebook.com/docs/apps/changelog. There are no changes for /me/photos as far as I can tell.
It is possible to use image data or a URL.
See https://developers.facebook.com/docs/graph-api/reference/user/photos#Creating for more info

How I can Unlike Comments on the Rss Feed using Graph API.?

Hello Guys I am working on WPF app and I want to Unlike the Comments what I have been like so I am using like this.
Facebook.FacebookClient api = new FacebookClient(ExpandingNewsFeedList[0].AccessToken);
api.Delete(ID);
But it will give me error like this
.(OAuthException) (#100) Can only call this method on valid test users for your app.
so how I Can overcome this problem.?
Thank you.!!
To unlike, do an HTTP DELETE to the /objectid/likes.
Using C#, it's like this
facebookClient.Delete("/" + objectId + "/likes");
You can't delete content using an app except for some types of content which your App added (e.g. an app can delete its own posts)

iPhone facebook integration

I am using Graph API in my application. I am fetching user's facebook wall feeds using graph API also getting details of particular post i.e (Like count,Comments etc).
but i want to allow user to Like and Comment any post from the application itself.
what is the request format for that?
Please help me or give any pointers.
Regards,
Sanket
You would be well served to check out the Publishing section of the documentation. It provides information such as this.
One example is liking, which is defined as:
Method: /OBJECT_ID/likes
Description: Like the given object (if it has a /likes connection)
Arguments: none
Basically, just initiate a Graph API call to something like:
[facebookObject requestWithGraphPath:#"98423808305/likes" andDelegate:self];
That will "like" a picture from Coca-Cola (ID taken from the documentation).
Edit 1
According to the documentation:
Most write operations require extended permissions for the active user. See the authentication guide for details on how you can request extended permissions from the user during the authentication step.
Are you sure you have enough privileges? Unfortunately the documentation is very unclear as to whether it serves the dual purpose of liking the object and returning the likes already on that object.
Edit 2
I did some more research into what could be causing this and came across this question and answer that indicated that the code I posted above using requestWithGraphPath:: should work. However, it does not due to a bug on Facebook's Bug Tracker.
Unfortunately, it looks like there is no way to "like" an object via the Graph API, which seems very strange to me. Perhaps it is possible with the legacy REST API instead of the Graph API?
Edit 3
Well, it looks like your best bet is the stream.addLike method of the legacy REST API which you can still call using the Facebook iOS SDK. You should be able to use the stream.addLike method to "like" something in the "stream". Unfortunately, it doesn't appear to support photos, videos, etc. Only posts and comments.
Finally i found the solution for LIKE option
We should use following method for like option.
-(void) requestWithGraphPath:(NSString *)graphPath
andParams:(NSMutableDictionary *)params
andHttpMethod:(NSString *)httpMethod
andDelegate:(id <FBRequestDelegate>)delegate
graphPath = /OBJECT_ID/likes
Paramas = dictionary with comment ,for like option use empty dictionary
HttpMethod should be POST
you should get response = true if the LIKE request is successful.

Post to facebook status with a URL / GET request? (or post)

I rather expect that this might be impossible - but I was wonderring if it was possible to post a facebook status via passing in a URL.
Something to the effect of
http://facebook.com/?status=<URL ENCODED STRING>
Wow. Almost a full year since I asked this question.
As an FYI and for my own future reference, I did eventually discover how to do this.
http://www.facebook.com/sharer/sharer.php?u=<url to share>&t=<message text>
https://twitter.com/intent/tweet?text=<message>
http://www.linkedin.com/shareArticle?mini=true&url=<url>&title=<title>&summary=<description>&source=<source>
Google plus does not have a good option to use this method in desktop, but you can use their mobile URL
https://m.google.com/app/plus/x/?v=compose&content=<message>
I found this solution useful also (here)
var facebook_url = 'http://www.facebook.com/sharer.php?'+
'u='+encodeURIComponent('http://google.com/?q=bla')+
'&t='+encodeURIComponent('Some Page Title');
There's a builtin CURL converter in the Graph API that gets you all you need.