I know how to create a "Follow me" button on Twitter, but I only want to display it if the user is not already following me. Is there a way to do this properly?
You can get a list of your own followers' ids using this endpoint: https://dev.twitter.com/docs/api/1/get/followers/ids
If you know their twitter handle, you can get the id of someone using your app using this endpoint: https://dev.twitter.com/docs/api/1/get/users/lookup
Then your button display code will look something like:
if ([arrayOfFollowerIds containsObject:idOfAppUser]){
followButton.hidden = YES;
}
Related
I have latitude, longitude of the center of map view and zoom of the view. How can I generate the URL like this https://goo.gl/maps/twqcy in iOS? So that I can send my friend message like this: "Please go to this place: https://goo.gl/maps/twqcy".
I searched for the answer, and here is what I got: I can build a string like:
https://www.google.com/maps/place/#20.982375,105.7903495,17z to send to my friends.
However, there are 2 issues:
1) When user tap/click in the link, I want to show a marker. Currently it only center at the point with certain zoom degree that I put in. How can I generate a link, so that when my friend click on the link, he will see a marker?
2) How to change the form of the url to shortened one i.e from https://www.google.com/maps/place/#20.982375,105.7903495,17z to https://goo.gl/maps/twqcy.
Please answer with code in iOS, preferably in Swift.
UPDATE: This answer my question: Get url shortened with Google API, AFNetworking in Swift
returns directly a shortened NSURL
https://github.com/H2CO3/Shortener/blob/master/NSURL+Shortener.m
I'm trying to integrate like button inside my application and i want to reward the user for the like with the code below.
How can i see if the user has liked or unliked the facebook page?..(i can add an target to button for UIEventValueChanged but it's a little bit ugly)
self.pageLikeControl.likeControlAuxiliaryPosition = FBLikeControlAuxiliaryPositionBottom;
self.pageLikeControl.likeControlHorizontalAlignment = FBLikeControlHorizontalAlignmentCenter;
self.pageLikeControl.objectID = #"https://www.facebook.com/pages/JocTemp/379725092198791";
I saw on a similar question this answer FBLikeControl callback but it doesn't find that class anymore...so i guess you can't
I am getting avatar pictures from Instagram follows of the logged in user using this line of Objective-C code:
NSString *urlString = [[NSString alloc] initWithFormat:#"https://api.instagram.com/v1/users/self/follows?count=-1&access_token=%#", self.accessToken];
Where accessToken designates the Instagram's access token of the logged in user.
If I now want to get the recently posted images from a subset of my follows, is there a way to query directly Instagram's backend to gain in efficiency?
Otherwise, how do I get all the images recently posted by my follows to then implement a query based on a subset of selected follows?
Thanks!
maybe what you mean is getting your feed
you can use this code url to get the your feed
https://api.instagram.com/v1/users/self/feed?access_token=ACCESS-TOKEN
if you want the get recent post from your following member. you can use this code url
https://api.instagram.com/v1/users/FOLLOWING-ID/media/recent/?access_token=ACCESS-TOKEN
you can get FOLLOWING-ID from ID that you get from user-id
maybe it can help you and other people.
If I create a facebook like button with data-href = "www.ohohohoho.com"
and ... some people like it.
How can I know if my logged user likes it with the SDK or Graph or FDK ? I saw that I can only retrieve the kind of
referenced page with :
https://stackoverflow.com/questions/11671094/retrieve-non-facebook-liked-pages-from-a-facebook-user
by doing :
https://graph.facebook.com/?ids=http://www.imdb.com/title/tt0117500/
But the rest not :(
Thank you
You cant get users that liked it. But you can know if determined user liked this.
ive been looking at the http://dev.twitter.com/pages/tweet_button#build-your-own-example , they have only show how to customize the thumbnail, but i all i need it just a 'no graphic' plain text, tweet count NUMBER. and integrate it my tweet post, so it counts the tweets for my post.
Im quite noob at this, does anyone know how to achieve this?
Thanks
Twitter does not have a public API to surface the share count for a URL. The button uses a private method that you could use but it is likely to change at anytime and will break your button if it does.
https://cdn.api.twitter.com/1/urls/count.json?url=http://google.com