General Plugin Information

There are a couple different ways to access the social networks using the plugin. This section will describe them so that you can decide which best fits your game. For quick, zero-setup access you can use the built in iOS share sheet via the SharingBinding.shareItems method. This lets you share text, screenshots and links using the iOS native accounts setup in the Settings.app. If you want a bit more control using the iOS native accounts you can utilize the other SharingBeinding methods described below. They let you access Facebook, Twitter, SinaWeibo, TencentWeibo and LinkedIn all with the same API.
Facebook and Twitter have their own separate APIs available via the FacebookBinding and TwitterBinding classes. Going this route gains you access to the Facebook SDK directly so you can use their different dialogs if desired. See the Facebook and Twitter sections below for more details.
Many functions of the plugin require that you setup an application with Twitter or Facebook. A call to the TwitterBinding.init method with your Twitter app details is required for Twitter usage for example. To register an app with Twitter, visit dev.twitter.com and click the "Register an app" link. For Facebook, you will need to setup your app at developers.facebook.com.

Facebook

iOS 9 Note: iOS 9 has some new restrictions that affect the Facebook SDK. You can read all about the small changes you will need to make to your Info.plist file on Facebook's documentation page.
Important: Facebook's 2.0 SDK has MAJOR changes to just about everything from authentication to permissions to the Graph API. Please read Facebook's upgrade guide and change log for the details on what has changed. There are also several new Info.plist additions required as detailed here.
The Facebook composer currently has a bug on iOS 8.3 that prevents the prefilled initial text from displaying. There are no known workarounds besides deleting the Facebook.app from the device (really). Facebook has deemed this not a bug and by design. They do not want developers prefilling text anymore.
For a quick demo of how to setup your Facebook app have a look at this video tutorial. Note that Facebook recently (after the video was made) added some new requirements that need to be added to the Info.plist file in addition to the FacebookAppID.
Facebook's Graph API documentation can be found here. To learn what can be done with Facebook and how to do it you must visit their documentation. Their API is humongous and there is no way for us to be familiar with all of it. Please do not send us support requests with questions about the Graph API. Visit Facebook's webpage, forums or contact their support crew with questions specific to it.
Once your application is setup, you will need call the FacebookBinding.init before any other methods. The latest version of the Facebook SDK uses their single sign-on system. This requires you to setup a URL scheme in your Info.plist file. We provided a way to make this much more painless for everyone. If you want more information on the single sign on system and what manual setup requires check out the Authentication and Authorization section on the Facebook SDK page.
The extra steps required for setting up a URL scheme/appId/displayName are pretty simple and for a quick overview video click here:
There are a couple methods you can use that do not require authenticating a user. If you want the easiest possible Facebook setup these are the methods you should be using: showFacebookComposer and showFacebookShareDialog. For any more advanced Facebook integrations you will want to log the user in so that you can access the Graph API. You do that by calling loginWithReadPermissions or loginWithPublishPermissions.
You can post to the user's wall without requiring the user to take any action by using Facebook.instance.postMessage or Facebook.instance.postMessageWithLink. You can also post images to the user's wall using Facebook.instance.postImage. Note: Facebook messages are limited to 420 characters and posting does require the publish_actions permission.
If you want advanced access to the Facebook Graph API you can use the Facebook.instance.graphRequest method to access almost anything available. The HTTPVerb parameter should be either GET or POST depending on the Graph API method you are calling. All requests accept as a parameter the completion handler which returns two objects: a string (error) and an object. The string will be an error message if an error occurred or null if no error occurred. The object will be either a Dictionary<string,object> or a List<object>. Please refer the Facebook Graph API documentation for more information on the available methods and what they return.

FacebookBinding.cs methods:

void init()

Initializes the Facebook plugin for your application

string getAppLaunchUrl()

Gets the url used to launch the application. If no url was used returns string.Empty

void setSessionLoginBehavior( FacebookSessionLoginBehavior loginBehavior )

Sets the login behavior. Must be called before any login calls! Understand what the login behaviors are and how they work before using this!

void renewCredentialsForAllFacebookAccounts()

iOS 6+ only. Renews the credentials that iOS stores for any native Facebook accounts. You can safely call this at app launch or when logging a user out.

bool isSessionValid()

Checks to see if the current session is valid

string getAccessToken()

Gets the current access token

List<object> getSessionPermissions()

Gets the permissions granted to the current access token

void login()

Opens the Facebook single sign on login in Safari, the official Facebook app or uses iOS 6 Accounts if available

void loginWithReadPermissions( string[] permissions )

Shows the native authorization dialog, opens the Facebook single sign on login in Safari or the official Facebook app with the requested read (not publish!) permissions. Results in the sessionOpenedEvent or loginFailedEvent firing.

void loginWithPublishPermissions( string[] permissions )

Authenticates/reauthorizes with the requested publish permissions. Results in the sessionOpenedEvent or loginFailedEvent firing.

void logout()

Logs the user out and invalidates the token

void graphRequest( string graphPath, string httpMethod, Dictionary<string,object> keyValueHash )

Allows you to use any available Facebook Graph API method

iOS Facebook composer and Share Dialog

void showFacebookShareDialog( FacebookShareContent parameters )

Shows the Facebook share dialog. Results in the shareDialogSucceeded/FailedEvent firing.

void showFacebookShareDialogWithImage( string imagePath, string caption = "" )

Shows the Facebook share dialog. Results in the shareDialogSucceeded/FailedEvent firing.

void showGameRequestDialog( FacebookGameRequestContent content )

void showAppInviteDialog( string appLinkUrl, string previewImageUrl = null )

Shows the Facebook game request dialog. Note that Facebook has lots of rules about the combination of data sent so be sure to read up on it: https://developers.facebook.com/docs/reference/ios/current/class/FBSDKGameRequestDialog/ Results in the gameDialogSucceeded/FailedEvent firing.

Facebook App Events

void logEvent( string eventName, Dictionary<string,object> parameters = null )

Logs an event with optional parameters

void logPurchaseEvent( double amount, string currency )

logs a purchase event

void logEvent( string eventName, double valueToSum, Dictionary<string,object> parameters = null )

Logs an event, valueToSum and optional parameters

uthHelper babysitter
Event handlers

Sharing and Accounts

The SharingBinding class provides direct access to the iOS native accounts and share features. By far the easiest way to share is via the shareItems method. It shows the iOS native share sheet which any app can register to be on. Most social networking apps already have a share item which will be accessible via the share sheet.
If you want more control and the ability to access the social networks public API you can use the fetchAccountsWithAccountType. This method will attempt to gain access to the social networking accounts setup via the iOS settings. You specify the social network that you want to access via the AccountType which contains all the available networks: Facebook, Twitter, SinaWeibo, TencentWeibo and LinkedIn. You will get back a list of all the accounts on the device for the social network that you ask for. You will want to call this method once per app launch so that you always have a fresh list of the accounts on the device. Once you have the accounts you are clear to call performRequest which directly access the specific social network using it's public API. You can visit each of the social network's documentation for a list of all the available endpoints for each.
The shareItems method lets you show the native Apple share sheet. It also lets you exclude certain applications when showing the sheet. You can pass in a string[] of the excluded activity types to do so. The full list of activity type strings is:

com.apple.UIKit.activity.PostToFacebook
com.apple.UIKit.activity.PostToTwitter
com.apple.UIKit.activity.PostToWeibo
com.apple.UIKit.activity.Message
com.apple.UIKit.activity.Mail
com.apple.UIKit.activity.Print
com.apple.UIKit.activity.CopyToPasteboard
com.apple.UIKit.activity.AssignToContact
com.apple.UIKit.activity.SaveToCameraRoll
com.apple.UIKit.activity.AddToReadingList
com.apple.UIKit.activity.PostToFlickr
com.apple.UIKit.activity.PostToVimeo
com.apple.UIKit.activity.TencentWeibo
com.apple.UIKit.activity.AirDrop

SharingBinding.cs methods:

void shareItems( string[] items )

Shows the share sheet with the given items. Items can be text, urls or full and proper paths to sharable files

void shareItems( string[] items, string[] excludedActivityTypes )

Shows the share sheet with the given items with a list of excludedActivityTypes. See Apple's docs for more information on excludedActivityTypes.

void setPopoverPosition( float x, float y )

iOS 8+ only and iPad only. Sets the popover arrow position for displaying the share sheet. Set this to match your share button location.

void fetchAccountsWithAccountType( AccountType accountType, Dictionary<string,object> options )

Fetches all the accounts of the given AccountType. Results in the accessGrantedForAccountsWithUsernamesEvent or accessDeniedToAccountsEvent firing.

void performRequest( AccountType accountType, string username, string url, SharingRequestMethod requestMethod = SharingRequestMethod.Get, Dictionary<string,string> parameters = null )

Performs a request using the specified AccountType and username (retrieved from fetchAccountsWithAccountType). Each service has it's own API format for the url so refer to their documentation directly for details on the url and parameters. Calling this reaults in the requestSucceeded/FailedEvent event firing.

Dictionary<string,object> createFacebookOptions( string appId, FBAudienceKey key, string[] permissions )

Helper method that creates the options Dictionary for a Facebook login. Pass this to fetchAccountsWithAccountType.

SharingManager.cs events:

event Action<string> sharingFinishedWithActivityTypeEvent;

Fired when sharing completes and the user chose one of the sharing options

event Action sharingCancelledEvent;

Fired when the user cancels sharing without choosing any share options

event Action<List<string>> accessGrantedForAccountsWithUsernamesEvent;

Fired when a call to fetchAccountsWithAccountType completes successfully. Includes all the account names on the device.

event Action<string> accessDeniedToAccountsEvent;

Fired when a call to fetchAccountsWithAccountType fails

event Action<string> requestSucceededEvent;

Fired when a call to performRequest succeeds. The event includes the response data string unmodifed. Refer to each services documentation for the format/spec of the actual data.

event Action<string> requestFailedEvent;

Fired when a call to performRequest fails. Includes the error message if present.

Twitter

The Twitter portion of the plugin requires that you set your deplyment target to iOS 9 or greater. You must also add your Twitter app consumer key in the info.plist editor (available in the Tools -> prime[31] menu in Unity) so the plugin can setup the proper URL schemes for authentication to work.
In order to use any Twitter features you will first need to setup a Twitter application on the Twitter developer site. You will need to send both the consumer key and the consumer secret to the TwitterBinding.init method before you can do anything else with Twitter. To login a user, call TwitterBinding.showLoginDialog. The loginSucceededEvent event on the TwitterManager class will get fired once a user is successfully logged in. The plugin will handle keeping the users access token for future posts until the TwitterBinding.logout method is called.
The showLoginDialog method will end up showing the Twitter web page in an in app browser or Twitter.app. Make sure you set it up on the Twitter website as a browser app! You do this by entering a callback url when registering. It will not be used but it still needs to be there for authentication to work. The redirect url you put in does not matter as it will not get used. Using whatever you set as your callback url is perfectly fine.

TwitterBinding.cs methods:

void init( string consumerKey, string consumerSecret )

Initializes the Twitter plugin and sets up the required oAuth information. You must call this before any other methods are used!

bool isLoggedIn()

Checks to see if there is a currently logged in user

string loggedInUsername()

Retuns the currently logged in user's username

void showLoginDialog()

Shows the login dialog via the Twitter app or in-app browser

void logout()

Logs out the current user

void postStatusUpdate( string status )

Posts the status text. Be sure status text is less than 140 characters!

void postStatusUpdateWithVideoOrGif( string status, string videoPath )

Posts the status text and a video or gif file. Note that this method requires that a native iOS twitter account is being used.

void postStatusUpdate( string status, string pathToImage )

Posts the status text and an image. Note that the url will be appended onto the tweet so you don't have the full 140 characters

void postStatusUpdate( string status, byte[] imageData )

Posts the status text and an image. Note that the url will be appended onto the tweet so you don't have the full 140 characters

void getHomeTimeline()

Receives tweets from the users home timeline

void performRequest( string methodType, string path, Dictionary<string, string> parameters )

Performs a request for any available Twitter API methods. methodType must be either "get" or "post". path is the url fragment from the API docs (excluding https:///api.twitter.com) and parameters is a dictionary of key/value pairs for the given method. Path must request .json! See Twitter's API docs for all available methods.

void sendDirectMessage( string to, string message )

sends a direct message

Tweet Sheet methods

void showTweetComposer( string status, string pathToImage = null, string link = null )

Shows the tweet composer with the status message and optional image and link

void showTweetComposerViewController( string status, string imagePath = null, string videoPath = null )

Shows the tweet composer view controller. Note that only an image OR a video can be included, not both.