Skip to content

Would like a way to trigger a share sheet / share intent #7111

Closed

Description

@eseidelGoogle

Likely best way is via a plugin? Both Android and iOS have share intent concepts.

Activity

  1. sethladd commented on Nov 30, 2016

    @sethladd
    Contributor

    See also #4530 and #4814

  2. sethladd commented on Dec 13, 2016

    @sethladd
    Contributor
  3. changed the title [-]Would like a way to trigger a share intent[/-] [+]Would like a way to trigger a share sheet / share intent[/+] on Feb 1, 2017
  4. added this to the milestone on Feb 1, 2017
  5. sethladd commented on Feb 8, 2017

    @sethladd
    Contributor

    If the scope of this issue includes the UI elements to trigger the share capability, the icon used for sharing should be platform specific. Use the iOS share icon when on iOS, e.g.

  6. modified the milestones: 2: Make Early Adopters happy, on Mar 15, 2017
  7. eseidelGoogle commented on Mar 15, 2017

    @eseidelGoogle
    ContributorAuthor

    Every one of Flutter's Early Access Partner has had the need to trigger a share flow from iOS, so I think we need to pull this into M2 (and can correspondingly bump other work as needed).

    What's needed in this bug is a proof of concept/example. Some explanation of how to create an iOS and Android share flow.

  8. xster commented on Mar 20, 2017

    @xster
    Member

    I'll need some ramp up on plugins but I can take a look at it next

  9. 1 remaining item

  10. xster commented on Mar 28, 2017

    @xster
    Member

    The share plugin is submitted in google3. I'd close this bug for now since the share specific part is done. It's just a matter of having a distribution mechanism with #7815 now.

  11. sethladd commented on Mar 28, 2017

    @sethladd
    Contributor

    Just for clarity, the plugin is also still available here: https://github.com/xster/flutter-plugin-share ?

    cc @mit-mit something to add to your docs, as another example

  12. xster commented on Mar 28, 2017

    @xster
    Member

    It is. I kept the code equivalent. Though I wouldn't quite call it a plugin since it's not 'unpluggable'. It's just the share logic hard coded into the 2 native codebases.

  13. sethladd commented on Mar 28, 2017

    @sethladd
    Contributor

    No worries. Important part: yay more Flutter integrations! :)

  14. TitikshaDaga commented on Aug 11, 2017

    @TitikshaDaga

    Hey,
    Has the share sheet been implemented. If no how do i make a share sheet?

  15. eseidelGoogle commented on Aug 11, 2017

    @eseidelGoogle
    ContributorAuthor
  16. agiratech-vigneshm commented on Mar 15, 2018

    @agiratech-vigneshm

    still I can't find a way to share an Image, is it in the pipeline or I missed the docs?

  17. rodydavis commented on Apr 19, 2018

    @rodydavis
    Contributor

    https://pub.dartlang.org/packages/share does not allow you to share a file. Only String. I am trying to Share a .vcf file for example.

    Future<String> get _localPath async {
       final directory = await getApplicationDocumentsDirectory();
    
       return directory.path;
     }
    
     Future<File> get _localFile async {
       final path = await _localPath;
       return new File('$path/contact.vcf');
     }
    
     Future<String> readCounter() async {
       try {
         final file = await _localFile;
    
         // Read the file
         String contents = await file.readAsString();
    
         return contents;
       } catch (e) {
         // If we encounter an error, return 0
         return "";
       }
     }
    
     Future<File> writeCounter(String data) async {
       final file = await _localFile;
    
       // Write the file
       return file.writeAsString('$data');
     }
    
     void shareContact() async {
       String str = "BEGIN:VCARD\n" +
           "VERSION:4.0\n" +
           "N:Gump;Forrest;;;\n" +
           "FN:Forrest Gump\n" +
           "ORG:Bubba Gump Shrimp Co.\n" +
           "TITLE:Shrimp Man\n" +
           "TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212\n" +
           "TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212\n" +
           "EMAIL:[email protected]\n" +
           "REV:20080424T195243Z\n" +
           "END:VCARD";
    
       writeCounter(str);
       final file = await _localFile;
    
       share(file.toString());
     }
    
  18. mit-mit commented on Apr 19, 2018

    @mit-mit
    Member

    Sorry to hear. Can you open a new bug for that, please?

  19. rodydavis commented on Apr 19, 2018

    @rodydavis
    Contributor

    WIll do!

  20. dmjones commented on Apr 23, 2018

    @dmjones

    FYI - the bug opened was #16743.

  21. agnoam commented on May 30, 2018

    @agnoam

    Hey, anyone know how to receive share sheet flie ?
    There is any plugin that do this ?

  22. github-actions commented on Sep 3, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  23. locked as resolved and limited conversation to collaborators on Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions