IOS Facebook SDK - Post Open Graph and show on Timeline without clicking Activity Log

IosFacebookFacebook Graph-ApiFacebook OpengraphFacebook Ios-Sdk

Ios Problem Overview


From the Facebook SDK sample code, when successfully posting the open graph object to the timeline, you have to click Show on Timeline in the Activity Log on the Facebook website.

How to ignore these steps and explicitly share your OG to timeline?

Ios Solutions


Solution 1 - Ios

I've moved this answer out of @isaacselement question.


Just add one more code to your FBOpenGraphAction Object:

id<FBOpenGraphAction> action = (id<FBOpenGraphAction>) [FBGraphObject graphObject];
[action setObject: @"true" forKey: @"fb:explicitly_shared"];  // This is the key point!

And you should enable the 'explicitly shared' setting for the open graph action in the Facebook Developer App Dashboard in the website.

For more details, look at the Document about Explicit Sharing

Solution 2 - Ios

You can use Scocial.framework for to directy post on facebook. It just use users built in facebook account associated with ios. And you will be able to post on timeline.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionisaacselementView Question on Stackoverflow
Solution 1 - IosPylyp DukhovView Answer on Stackoverflow
Solution 2 - IosHRD0701View Answer on Stackoverflow