1

I'm using the following code to post image on Facebook

-(void) facebookShare: (id) sender
{
    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
    {
        SLComposeViewController *facebookSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
        CCScene *myScene = [[CCDirector sharedDirector] runningScene];
        CCNode *node = [myScene.children objectAtIndex:0];
        [facebookSheet addImage: [GameOverLayer screenshotWithStartNode:node]];
        [facebookSheet setInitialText:[NSString stringWithFormat:@"I just scored %d in an awesome game of XXX", scoreNum]];
        [[CCDirector sharedDirector] presentViewController:facebookSheet animated:YES completion:nil];
    }
    else
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Please login to Facebook to share your score!" delegate: self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Login",nil];
        [alert show];
    }    
}

The code works fine, but I'm wondering how I can create a specific album for the game, and post the image to that album? Thanks!

Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
alanlzl
  • 41
  • 7

0 Answers0