NatShare is primarily built around social sharing. The SharePayload exposes this functionality, allowing you to share content to other apps using the native sharing UI. To begin, create a payload:
var payload = new SharePayload();
The payload acts as a write-only collection of items to be shared. Shareable items include plain text, images (Texture2D objects), and media files (referenced by their file paths).
// Add textpayload.AddText("Sharing is caring");// Add imagepayload.AddImage(texture);// Add a media filepayload.AddMedia("/path/to/video.mp4");
Once all the items have been added to the payload, it can be committed to the operating system for sharing:
NatShare supports reporting whether a given share action was successfully chosen by the user.
// Share and get success valuevar success = await payload.Commit();