plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[share_plus] Need to get the share method i.e Facebook, WhatsApp etc after sharing content

Open abhisheka-asconsoft opened this issue 2 years ago • 5 comments

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,
    );
  }

abhisheka-asconsoft avatar May 03 '22 09:05 abhisheka-asconsoft

Is there any update on this?

dhimanrascon avatar May 10 '22 09:05 dhimanrascon

Have you tried shareWithResult?

miquelbeltran avatar Jun 01 '22 05:06 miquelbeltran

@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.

abhisheka-asconsoft avatar Jun 05 '22 07:06 abhisheka-asconsoft

There is no way to get the exact application that user selected.

vbuberen avatar Jun 05 '22 10:06 vbuberen

@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 ;)

Coronon avatar Jul 06 '22 08:07 Coronon

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

SirusCodes avatar Oct 23 '22 14:10 SirusCodes