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
SocialShareSheet Class Reference

Provides an interface to display native view with various social share services that your users can choose to use from your application. More...

Public Member Functions

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

Additional Inherited Members

- Properties inherited from ShareSheet
string Text [get, set]
 The string contains the text message to be shared. More...
 
string URL [get, set]
 The string contains the URL to be shared. More...
 
byte[] ImageData [get]
 The raw data of the image to be shared. (read-only) More...
 
virtual eShareOptions[] ExcludedShareOptions [get, set]
 The list of services that should not be displayed. 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 display native view with various social share services that your users can choose to use from your application.

The following code example demonstrates how to use share sheet with social network services only.

using System.Collections;
public class ExampleClass : MonoBehaviour
{
public void ShareViaShareSheet ()
{
// Create new instance and populate fields
SocialShareSheet _shareSheet = new SocialShareSheet();
_shareSheet.Text = "This is a test message.";
// On iPad, popover view is used to show share sheet. So we need to set its position
NPBinding.UI.SetPopoverPointAtLastTouchPosition();
// Show composer
NPBinding.Sharing.ShowView(_shareSheet, FinishedSharing);
}
private void OnFinishedSharing (eShareResult _result)
{
// Insert your code
}
}

Constructor & Destructor Documentation

Initializes a new instance of the SocialShareSheet class.