aarajput / wc_flutter_share

A Flutter plugin for sharing files & text with other applications.
Apache License 2.0
35 stars 19 forks source link

Release mode not work #15

Closed phcaraujo closed 4 years ago

phcaraujo commented 4 years ago

I am using the plugin to share photo and text, however, in the release version of the application sharing does not work.

When I'm using the debug version the sharing works perfectly.

Can someone help me?

void _shareImageAndText() async {
    try {
      var imageUrl = 'https://www.dropestore.com/img/07717000.jpg';
      var imageId = await ImageDownloader.downloadImage(imageUrl);
      var path = await ImageDownloader.findPath(imageId);
      var mimeType = await ImageDownloader.findMimeType(imageId);
      final ByteData bytes = await rootBundle.load(path);
      await WcFlutterShare.share(
          sharePopupTitle: 'share',
          subject: 'Title',
          text:
              'Body message',
          fileName: 'share.jpg',
          mimeType: mimeType,
          bytesOfFile: bytes.buffer.asUint8List());
    } catch (e) {
      print('error: $e');
    }
  }
Yashank18 commented 4 years ago

Same I am using the same code and it's working fine when I am on debug mode. Can you please tell is this about any android permissions? @aarajput

aarajput commented 4 years ago

Have you tried adding internet permission in main manifest file?

Yashank18 commented 4 years ago

Yes, I have added internet permission, read external permission and write external permission as well.

aarajput commented 4 years ago

Is it throwing some exception?

Yashank18 commented 4 years ago

@aarajput No, when I use this in debug or on my emulator it works fine and pretty accurate but when I use this is my released apk/ built apk. It doesn't work at all

aarajput commented 4 years ago

Have you tried example code?

Yashank18 commented 4 years ago

Yes, it is not working with release mode

aarajput commented 4 years ago

Strange. I will look into this.

Yashank18 commented 4 years ago

@aarajput any updates, I need to use this in my app that is completed. Can you please tell me any solution?

Yashank18 commented 4 years ago

@aarajput What I think is we need some other permissions as well her because in debug mode application have all the permissions but while release apk, there is a need for some more dependencies.

aarajput commented 4 years ago

I am sorry, I didn't get time to look into this issue. Can you fork this repo and try to fix it and send me p.r?

Yashank18 commented 4 years ago

@aarajput I will try

aarajput commented 4 years ago

There is an issue with your implementation. I have tested this on example.