/// <summary> /// Invokes the native sharing mechanism of the device. /// Use CanShare to check if this is allowed /// </summary> /// <returns></returns> public async ValueTask Share(ShareData shareData) { await JsRuntime.InvokeInstanceMethod <bool>(JsObjectRef, "share", shareData); }
/// <summary> /// Returns true if a call to Share() would succeed. /// Returns false if it would fail or sharing is not supported /// </summary> /// <returns></returns> public async ValueTask <bool> CanShare(ShareData shareData) { return(await JsRuntime.HasProperty(JsObjectRef, "canShare") && await JsRuntime.InvokeInstanceMethod <bool>(JsObjectRef, "canShare", shareData)); }