I would like to make post with an image, message and mention some friends. I'm posting photo using Graph API
[FBRequestConnection startWithGraphPath:@"me/photos" parameters:dictionary HTTPMethod:@"POST" completionHandler:
and got friends list using
[FBRequestConnection startWithGraphPath:@"/me/taggable_friends"
parameters:nil
HTTPMethod:@"GET"
completionHandler:
every friend has an id like this "AaJIwZcI7HgWAY1FXkqc5AMjIzE3k8TEuv9YligJRa_2M1EmZ3iGvFZxRpF6s1eW3pCNKep2RUxy5KWH3WgOSUH3QSRLH_RRaTlfgcFjRX9DpQ" but how implement this id in message?
I have used different ways but nothing:
https://developers.facebook.com/docs/opengraph/using-actions/v2.1#people
[dictionary setObject:array forKey:@"tags"];
[dictionary setObject:[NSString stringWithFormat:@"@[%@:1:%@]",userID,userName]forKey:@"message"];
Any idea or something that help?
By enabling Facebook integrations, including through this SDK, you can share information with Facebook, including information about people’s use of your app. Facebook will use information received in accordance with our Data Use Policy, including to provide you with insights about the effectiveness of your ads and the use of your app.
Click on Customize Settings. Step 3: Check the box Scroll down to the category "Things others share" on the Customize Settings page. Under that category is a "Friends can post on my Wall" option with a check box. Click the box to enable Friends to post to your Wall.
Make sure they can get to your Wall by checking your settings. Step 1: Log into Facebook Log into Facebook. Click the Account button, and then Privacy Settings. TIP: Review all your Privacy Settings to make sure you are only showing people what you want.
You can also download the latest version of the Facebook iOS SDK, integrate it into your app, and recompile. Beginning with SDK v13.0, set to release in early 2022, a Client Token will be required for all calls to the Graph API. The Facebook SDK for iOS contains component SDKs that you can connect to individually.
Mentioning friends may looks pretty easy, but in fact it is really complicated thing worth big tutorial and involving a lot of steps to be done and api requests to be performed. To do this you should create object and do some action with it. As for terminology:object consists of generic data such as type, image, title, url, custom fields, etc. action consists of object and can also mention friends. Thus:
Get taggable friends and keep their pseudo-ids.
Perform request for action. It is the place where all magic is done. Perform request with necessary fields: "image", "tags" and, probably "fb:explicitly_shared" (obviously set to true). Note that "image" is array, "tags" are comma-separated values, "fb:explicitly_shared" is boolean value. From the ios perspective request could look like this:
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"me/%@", kFBActionNameFull]
parameters:@{kFBObjectNameShort:objectId,
@"fb:explicitly_shared":@"true",
@"tags":@"friend1_tag,friend2_tag",
@"image":@[@{@"image":@"some_url",
@"user_generated":@"true"}]}
HTTPMethod:@"POST"
completionHandler: ...]
After all this steps you could see story on your page.
As you can see mentioning friends is very difficult task, requiring a lot of time to implement. I could add some code to explanation above, but without deep understanding of stories mechanism you can not successfully post image and tag friends
And yes, you must
in order to use your app into production.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With