Capacitor Share

Hi everyone! Does anyone have a capacitor share example? I need to share some text with WhatsApp. I don’t know if there is a deep link to reference.

I literally have

import { Plugins } from '@capacitor/core';
const { Share } = Plugins;

let shareRet = await Share.share({
 title: 'See cool stuff',
 text: 'Really awesome thing you need to see right meow',
 url: 'http://ionicframework.com/',
 dialogTitle: 'Share with buddies'
});

I got the following error:
ERROR Error: Uncaught (in promise): Web Share API not available

As the error says, the browser where you are testing doesn’t support web share

I could see that. But you focused on the error, not in the question. Is there a more fully formed example out there to share specific content?

You have a totally valid example, that’s why I focused on the error and not on the question, not sure what other kind of example do you want.

1 Like