This interface defines common functionality for all of the social sharing payloads which NatShare provides. As such, all payloads implement this interface.
/// <summary>/// Add text to the payload./// </summary>ISharePayload AddText (string text);
Some payloads support adding text to be shared.
/// <summary>/// Add an image to the payload./// </summary>/// <param name="image">Image to the shared.</param>ISharePayload AddImage (Texture2D image);
This method can be used to add images to be shared.
/// <summary>/// Add a media file to the payload./// </summary>/// <param name="path">Path to media file to be shared.</param>ISharePayload AddMedia (string path);
It is often desirable to share media files which live on the file system. This method allows for doing so. You can share audio files, image files, video files, and more with this method.
/// <summary>/// Commit the payload and return success value./// </summary>Task<bool> Commit ();
Once you are done adding items to the payload, you can use this method to trigger the sharing action associated with the payload. The sharing action is asynchronous, and returns a
bool indicating whether the items were successfully shared. It can be used like so:
// Create a payload and add itemsvar payload = new ...;...// Share and check whether sharing succeededvar success = await payload.Commit();