Facebook Multiple tagging on Photo ios - ios

I am using FB graph api to tag multiple friends. I am able to tag only one friend. But not getting success with multiple friends.
For single user:-
NSString *photoID=#"23451245";
[FB_Graph doGraphPost:[NSString stringWithFormat:#"%#/tags/%#?access_token=%#", photoID, #"1235234",[[NSUserDefaults standardUserDefaults]objectForKey:#"fb_accesstoken"]] withPostVars:nil];
For Multiple user :-
[FB_Graph doGraphPost:[NSString stringWithFormat:#"406435626092354/tags?tags=[{\"id\":\"100000947629523\"}, {\"id\":\"100000106756234\"}]?access_token=%#",[[NSUserDefaults standardUserDefaults]objectForKey:#"fb_accesstoken"]] withPostVars:nil];

tags
Create:
You can create a tag on the photo by issuing an HTTP POST request to the tags connection, PHOTO_ID/tags.
Note: This feature is intended to help users tag their friends in real photos. You should not use this feature to encourage users to tag their friends if their friends are not actually in that photo, or to tag friends in composite photos. If your app is found to be encouraging this behavior, your usage of this feature may be disabled.
You can specify which user to tag using two methods: in the URL path as PHOTO_ID/tags/USER_ID, or in a URL parameter as PHOTO_ID/tags?to=USER_ID. To add several tags at once, you can specify a tags property which contains an array of tags like so PHOTO_ID/tags?tags=[{"id":"1234"}, {"id":"12345"}]. Currently, you cannot tag a Page in a photo using this API.
Tagging a photo requires the user_photos and publish_stream permissions, publish_stream is optional - if not present, the tag will go through Tag Review of the tagged person if s/he has this privacy setting enabled. Tagging a photo supports the following parameters.
For more details visit Facebook Developer Site.

Related

is there an API to get all of an Instagram business account's posts that include a particular hashtag?

I am trying to get media with an hashtag that is specific to a particular user. Instead, the api seems to provide all the public images with the hashtags that is not specific to the account.
This is the api to get media nodes using hashtag that I tried:
{hashtag-id}/recent_media?user_id={iguserId}&fields=id,media_type,comments_count,like_count,caption
This one returns the public images associated with that particular hashtag in addition to the account's media that I need. For example:
I am requesting for images in a user's account that has #xxxx as hashtag. I am expecting the account's images alone containing xxxx tag. However, in the response I am receiving images from other accounts as well which has the same #xxxx hashtag. This api seems to work globally and I don't understand the use of 'user_id' parameter in the api.
Check out this API. Very simple to use and you can get media from a hashtag and specify an account. This will help you get all of an Instagram business account's posts.
Python 3.x Implementation:
import instaloader
# Get instance
L = instaloader.Instaloader()
#Load the UserName
profile = instaloader.Profile.from_username(L.context, USERNAME)
#Read the profile posts and downloads those containing the hashtags
for i in profile.get_posts():
if HASHTAG in i.caption_hashtags:
L.download_post(i, target=DIRECTORY_NAME)

A Post shared using Facebook Open Graph API doesn't appear on the timeline when shared user's profile is accessed from a friends profile

Following OG tags are used when sharing a blog article from a iOS application.
og:type
og:title
og:description
og:url
fb:explicitly_shared
og:image
The app sets the "og:type" as "article" and "fb:explicitly_shared" tag as "true". When the post is successfully shared from the application. It shows on the timeline of the person who shared it but, It's hidden from the friends of the person who shared it. The post is shared as public.
Has anyone experienced this issue?

Inviting *all* your friends to the Facebook Application

At the moment, using the requests dialogue I can get a multi-friend selector come up when I want the user to invite their friends to my application (that's when the "to" parameter isn't defined). On Chrome / Safari - this is a new window, but is there any way of having all of the users friends already selected?
Otherwise - is there a way to put together a request / invite to all of the users friends? I've tried getting an array of all the user's friends id's into the "to" parameter, but that gives an error on FB.
I've seen a few applications on facebook that do make it possible for the user to "select all" or "invite all" of their friends - http://blog.fbsocialapps.com/2011/10/5-ways-to-tune-your-requests-to-improve-the-virality-of-your-facebook-application/
Edit - As mentioned in the comments, I'm doing this on RoR using the omniauth gem + JS SDK. I was hoping that someone may have come across this problem, and can share a solution. My intentions are not to spam, but make it easier for the user to share the application if it's worth sharing.
Basically what the apps mentioned on the site you posted are doing is to use a custom friend selector (See also: Requests Pro-Tips, Pro-Tip 2: Create a Custom Multi-Friend Selector).
This is pretty easy and straight-forward – read the list of the users friends, generate the kind of HTML you’d like them to be displayed with (a Form, an UL, IMG elements with the friends profile picture, Checkboxes to select friends, …). If you don’t want to use the JS SDK, you can do that (reading friends list + generate the HTML) server-side as well in your RoR app.
Only the part where the user can select all friends at once is probably best done client-side – loop through all the HTML elements representing the listed friends, and check the checkboxes via script. Pretty easy if you are for example using jQuery or something.
(Of course this could also be done by just having a checkbox labeled “send request to all friends”, and see if this is checked server-side and then send request to all friends – but that would not provide direct feedback that all friends are selected now to the user on the page.)
Then you could just send the form with all/some friends marked in it to your server-side app, generate the URL for the request dialog there and put the friend’s ids into the toparameter, and redirect the user’s browser to it.

Twitter: How to get "View photo" on tweet

We just included a pure HTML link for the tweet functionality instead of the twitter button. Now we want to enable the user to tweet an image together with his tweet.
When you manually tweet an url from instagram or flickrm, twitter automatically adds the "View photo" function below the tweet? How did I get that on my page?
I already found out, that both instagram and flickr use og properties. My guess was, that I have to add those properties to my page. But even adding those properties does not trigger the "View photo" link on twitter.
Is there some documentation about how to get it working? I didn't found anything in the API docs.
The View Photo link on Twitter is not related to OpenGraph. The photo provides are approved by Twitter so it automatically adds the View Photo link to tweets that include one of those services. If you want the View Photo link in your tweets, consider uploading photos using the TwitPic API or similar.

What is the best practice to store twitter profile images

The Twitter API documentation for GET users/profile_image/:screen_name states that:
This method should only be used by application developers to lookup or check the profile image URL for a user. This method must not be used as the image source URL presented to users of your application.
This API call returns a 302 redirecting to the profile image url. What is the best practice to make those images available for ones application? The easiest way it seems, would be to use the resulting url string and embbed it in the apps html code (e.g. in the src of an img tag). The alternative would be to store the image locally as a file or in a blob field.
Is linking the image covered by the "must not" or does that mean that you shall not call the API, but you do can use the resulting url?
In the past, I've simply stored the URL in the database and then reused the url when I needed to present the image.
Pulling down and storing the images is more complex and adds a dependency for access to the stored images on your application.
I'd also recommend that you re-fetch the image url periodically as users change their profile pics sometimes.
The twitter api states:
Once an end user has authenticated via Connect with Twitter, you must clearly display the end user's Twitter identity. Twitter identity includes visible display of the end user's avatar, Twitter user name, and the Twitter "bird" mark. Displays of the end user's followers on your Service must clearly show that the relationship is associated with the Twitter service.

Resources