Book Image

Mastering Cocos2d Game Development

By : Alex Ogorek
Book Image

Mastering Cocos2d Game Development

By: Alex Ogorek

Overview of this book

Table of Contents (15 chapters)
Mastering Cocos2d Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sharing on Facebook and Twitter (and more)


Sharing games on social media is very common these days. Our game will not be an exception to that. It's not only an effective marketing tool for your game, as users promote the game for you on their social media pages, but also a great way for engagement to rise, as humans love competition. Being able to share and compare their scores (and indirectly compete) makes users want to play the game even more, which makes it a win-win situation for both the developers and players.

Using the built-in share feature

The easiest way to integrate Facebook, Twitter, messaging, e-mail, and other sharing options is through the UIActivityView object. It's the same sharing you'll see when you press the button in the bottom-left corner of the photos app.

Basically, all we need to do is tell the ActivityView object what we want to display and what activity types we want to exclude, and then present the view controller over the CCDelegate.

First, we need to create the...