ios_dev
ios_dev

Reputation: 1035

How to post multiple images using SLComposeViewController on Facebook and Twitter in same album

I am new in iOS/Objective-c. I am working on one application that can share multiple images on Facebook and twitter. I have found code but When I am using that/below code on Facebook, all the images are posted as a separate post.

SLComposeViewController *composeViewController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
if (composeViewController)
    {
        for (int i=0; i<images.count; i++)
        {
            [composeViewController addImage:[images objectAtIndex:i]];
        }

        [composeViewController setCompletionHandler:^(SLComposeViewControllerResult result)
         {
             if (result == SLComposeViewControllerResultDone)
             {
                 //NSLog(@"Posted");
                 UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Successful" message:@"Image successfully posted." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
                 [alert show];
             }
             else if (result == SLComposeViewControllerResultCancelled)
             {
                 //NSLog(@"Post Cancelled");
             }
             else
             {
                 //NSLog(@"Post Failed");
             }
         }];

        [self presentViewController:composeViewController animated:YES completion:nil];
    }

So I want to know how to post multiple images and is it possible to post multiple images in a single tweet or in a single album? Thanks in advanced.

Upvotes: 0

Views: 331

Answers (1)

viratpuar
viratpuar

Reputation: 554

Not possible with SLComposeViewController use FBRequestConnection is much better.

Upvotes: 2

Related Questions