# WebShare

Wisej.NET's WebShare extension is an integration for the [Web Share API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API) available in most browsers.

{% embed url="<https://github.com/iceteagroup/wisej-extensions/tree/master/Wisej.Ext.WebShare>" %}
WebShare source code
{% endembed %}

## Example Code

<pre class="language-csharp"><code class="lang-csharp">var canShare = WebShare.CanShare();
//canShare is a Task&#x3C;Object> with several properties:
//AsyncState, CancellationPending, CreationOptions, Exception, Id, Result, Status

if (canShare.Exception == null)
<strong>{
</strong>    string title = "MDN";
    string text = "Learn web development on MDN!";
    string url = "https://developer.mozilla.org";
    WebShare.ShareAsync(url, text, title);
}
</code></pre>

This is the result of the example code:<br>

<figure><img src="https://2248866391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFp7MR1wemvcC5891_r%2Fuploads%2FSjs8pWObKmYaBNRU8hZE%2Fwebshare.png?alt=media&#x26;token=d5132177-e37a-4899-8888-41a7b22ce3ac" alt=""><figcaption></figcaption></figure>

## How to use

The WebShare extension can be added to a Wisej.NET project using NuGetPackage Manager.

{% embed url="<https://www.nuget.org/packages/Wisej-3-WebShare>" %}
