share method

JSPromise<JSAny?> share([
  1. ShareData data
])

The share() method of the Navigator interface invokes the native sharing mechanism of the device to share data such as text, URLs, or files. The available share targets depend on the device, but might include the clipboard, contacts and email applications, websites, Bluetooth, etc.

The method resolves a Promise with undefined. On Windows this happens when the share popup is launched, while on Android the promise resolves once the data has successfully been passed to the share target.

The Web Share API is gated by the web-share permission policy. The share() method will throw exceptions if the permission is supported but has not been granted.

Implementation

external JSPromise<JSAny?> share([ShareData data]);