i probably have a pretty stupid question. I work on a SpriteKit game and i want users to be able to share their Highscores on Facebook and Twitter. The posts should contain a text and an image. The code i have works with Twitter but not with Facebook and i have no clue why.. Here is the Facebook part:
#import <Social/Social.h>
...
SLComposeViewController *facebookSheet = [SLComposeViewController composeViewControllerForServiceType: SLServiceTypeFacebook];
facebookSheet.completionHandler = ^(SLComposeViewControllerResult result) {
switch(result) {
case SLComposeViewControllerResultCancelled:
break;
case SLComposeViewControllerResultDone:
break;
}
};
[facebookSheet setInitialText:[_playerName stringByAppendingString: @" has a new Highscore"]];
[facebookSheet addImage:[UIImage imageNamed:_HighscoreImage]];
UIViewController *controller = self.view.window.rootViewController;
[controller presentViewController:facebookSheet animated: YES completion:nil];
To solve this we can go for FBSDKSharKit.Install FBSDK pod file.
For detail description on using ShareKit check my other answer.