SharePayload
class NatML.Sharing.SharePayload : IDisposable
The SharePayload
is used to share items using the native sharing UI.
Creating the Payload
This payload does not require any parameters.
Adding Text
Add plain text to be shared in the payload.
Adding Images
The AddImage
method adds an image to be shared.
Ensure that the added image.isReadable
.
Adding Media Files
The AddMedia
method adds a media file at a given path
.
This method can be used to add audio, image, and video files.
Sharing the Payload
The Share
method sends the payload to the native OS sharing service, where a UI dialog will be presented to the user to select an app. Once the user completes the sharing action, the return task completes with the app ID of the receiving app.
The share task returns null
if the user cancels the sharing action.
Disposing the Payload
Once the payload has been used, it must be disposed.
Last updated