Facebook iOS6 integration adds image to album and

2019-09-02 22:44发布

问题:

I am trying to post to Facebook from my iOS app using the Social Framework. Using the SLComposeViewController, I have successfully added text and image to a Facebook post

SLComposeViewController *postVC = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[postVC setInitialText:messageText];
[postVC addImage:[UIImage imageNamed:@"share-this.png"]];
[self presentViewController:composeVC animated:YES completion:nil];

Now, the user of my app can post multiple times to their timeline within minutes. When I try this, Facebook collates all the posts into the album "iOS Photos" and does not show it as a separate post. This is what it shows - John Doe added 3 photos to the album iOS Photos.

I want to know if there is a way that I can post them as separate posts and not having them collated into an album. Can I do this using the SLComposeViewController's methods itself or do I have to manage posting to Facebook myself using the various Account management APIs in Social Framework?

回答1:

There isn't really much that you can do about this. What you're witnessing is a news feed function that Facebook has developed for organization purposes. What I mean by that is that even though you created several different posts, when it comes time to display them to a user, Facebook detects that in a short period of time you have several image posts to the same album and groups them together.

The only possible workaround would be to suggest to your user that they select different albums every time the composer is presented. But, even then I'm not sure how much of a difference this would make. Facebook may notice the post occurred in a short time frame, and all included images, and may group them anyway as:

John Doe uploaded x photos

Without specifying which albums they were uploaded to.