ShareKit is an awesome library for sharing almost any content with a number of social media sites. It’s incredibly powerful and can share images, URLs, text and even files. It’s smart enough to which social sites can accept which content and only show the services that can handle that content.
This was a really simple one but I wanted to share in case anyone else wants to combine ShareKit and Cocos2d for iPhone. First, follow the ShareKit instructions for installing and add it to your project. Now to display the sharekit action sheet, it’s dead simple:
In your .m file, include the sharekit sources:
Then when you want to display the shareKit:
//Create your shared item, in this case it's the level score
SHKItem *item = [SHKItem text:[NSString stringWithFormat:@"I scored %i in %@ of Pond Hopper", levelFinalScore, [self getLevelGroupName:self.levelGroup]]];
//Create the sharekit action sheet
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
//Show the action sheet in the openGLView
[actionSheet showInView:[CCDirector sharedDirector].openGLView ];
Simple as that.