Reputation: 2557
This article tells me it can be done while this says it's not possible at all. Am I reading the links wrongly? What is the most effective way to have a share button on a webapp built by WebView?
Upvotes: 1
Views: 2357
Reputation: 1398
You can share using android default share bottom sheet. use the following component.
if (navigator.share) {
navigator.share({
title: 'Web Fundamentals',
text: 'Check out Web Fundamentals — it rocks!',
url: 'https://developers.google.com/web',
})
.then(() => console.log('Successful share'))
.catch((error) => console.log('Error sharing', error));
}
This provides native sharing experience on Android devices while using web.
Upvotes: 2