Hello. i have a working javascript sharing function (port from another project) that i'd like to use in my webgl project but i dont think it is suitable with unity's webgl.
i have a Pugins folder in the Assets with the .jslib file. in the file :
mergeInto(LibraryManager.library, {
Sharing: function () {
if (navigator.share)
{
navigator.share({
title: 'Street Food Festival',
text: 'Check out it out',
url: 'ur',
}).then(() => console.log('Successful share')).catch((error) => console.log('Error sharing', error));
}
else
{
alert('Sorry. Sharing not available on your device')
}
}
});
c# script wise :
[DllImport("__Internal")]
private static extern void Sharing();
public void ShareExperience()
{
Sharing();
}
and a button click is suppose to trigger it. but when i try to build and run to test, unity throws errors. im pretty sure its the Sharing function but im not sure how to fix it.
↧