Cross Platform Native Plugins
A true cross platform tool for Unity which provides unique and unified way to access native functionality on mobile platforms.
Public Member Functions | List of all members
TwitterShareComposer Class Reference

Provides an interface to compose a post and publish it on Twitter. More...

Public Member Functions

 TwitterShareComposer ()
 Initializes a new instance of the TwitterShareComposer class. More...
 
- Public Member Functions inherited from SocialShareComposerBase
override void AttachImage (Texture2D _texture)
 Adds the specified image to the post. More...
 

Additional Inherited Members

- Properties inherited from SocialShareComposerBase
string Text [get, set]
 The string contains the text message to be posted. More...
 
string URL [get, set]
 The string contains the URL to be posted. More...
 
byte[] ImageData [get]
 The raw data of the image to be posted. (read-only) More...
 
- Properties inherited from IShareView
bool IsReadyToShowView [get]
 A bool value that indicates whether this instance is ready to present composer view. (read-only) More...
 

Detailed Description

Provides an interface to compose a post and publish it on Twitter.

The following code example shows how to compose a tweet message.

using System.Collections;
public class ExampleClass : MonoBehaviour
{
public void ShareViaTwitter ()
{
if (NPBinding.Sharing.IsTwitterShareServiceAvailable())
{
// Create new instance and populate fields
_composer.Text = "This is a test message.";
// Show composer
NPBinding.Sharing.ShowView(_composer, FinishedSharing);
}
else
{
// Device doesn't support posting on Twitter
}
}
private void OnFinishedSharing (eShareResult _result)
{
// Insert your code
}
}

Constructor & Destructor Documentation

Initializes a new instance of the TwitterShareComposer class.