plus_plugins
plus_plugins copied to clipboard
[share_plus] Need to get the share method i.e Facebook, WhatsApp etc after sharing content
Use case
My team has been building a complex application using Flutter. It has been greate except a few hiccups. Currently, we need to log the sharing method which has been used by user for sharing content from our app.
Proposal
It would be better if we can get the share method after user taps on any of the options in the intent tray. Like currently the share function returns void which gets completed post user-selection. So what we wanted from it to return the share method instead.
static Future<void> share(
String text, {
String? subject,
Rect? sharePositionOrigin,
}) {
assert(text.isNotEmpty);
return _platform.share(
text,
subject: subject,
sharePositionOrigin: sharePositionOrigin,
);
}
Is there any update on this?
Have you tried shareWithResult
?
@miquelbeltran shareWithResult
only returns user's action with the share-sheet. While what I am looking for is the method(app) that user has selected for sharing. Although thank you for this.
There is no way to get the exact application that user selected.
@miquelbeltran
shareWithResult
only returns user's action with the share-sheet. While what I am looking for is the method(app) that user has selected for sharing. Although thank you for this.
That is not quite correct. You can use the raw
property to get more info on what app the user selected. We do not give any strong guarantees for the value though ;)
There is no way to get the exact application that user selected.
I guess we can close this as it is out of scope of this plugin and can't be done as @vbuberen said