intent icon indicating copy to clipboard operation
intent copied to clipboard

How can I make intent for share a pdf file to app, for example whatsapp, printter app and email?

Open basketball-ico opened this issue 5 years ago • 1 comments

I try this but not work, please help me :D

For an App:

Intent()
        ..setAction(Action.ACTION_SEND)
        ..setData(Uri.parse('package:com.whatsapp'))
        ..putExtra(Extra.EXTRA_STREAM, file.path)
        ..startActivity().catchError((e) => print(e));

For an email:

Intent()
      ..setAction(Action.ACTION_SENDTO)
      ..setData(Uri(scheme: 'mailto'))
      ..putExtra(Extra.EXTRA_SUBJECT, 'Subject')
      ..putExtra(Extra.EXTRA_STREAM, file.path)
      ..startActivity().catchError((e) => print(e));

basketball-ico avatar Jan 18 '20 07:01 basketball-ico

Any example on this, please?

ravsom avatar Sep 24 '20 08:09 ravsom