Book Image

PhoneGap By Example

Book Image

PhoneGap By Example

Overview of this book

Table of Contents (17 chapters)
PhoneGap By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sharing on Twitter, Facebook, and other social media


It is always good to add some social media to the PhoneGap/Cordova application. We can draw attention to our application when users do the promotional work for us. What we need is to add share buttons for Facebook, Twitter, Tumblr, and other social media on our application. But how do we make it work for PhoneGap? We can use the PhoneGap Social Sharing plugin.

Tip

You can read details about this plugin at https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.

We get the Game Over! screen implemented so that we can use this plugin now to provide the ability to share our achieved results.

First of all, let's install the plugin. We can do this using the well-known method, which is as follows:

$ cordova plugin add nl.x-services.plugins.socialsharing

With this plugin, we can have our iOS, Android, or Windows Phone open the native share widget. The user can share results on the social media of his choice.

With the plugin, we can share:

  • Text...