Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing is not working while create IPA #32

Open
g212gs opened this issue May 9, 2021 · 1 comment
Open

Sharing is not working while create IPA #32

g212gs opened this issue May 9, 2021 · 1 comment

Comments

@g212gs
Copy link

g212gs commented May 9, 2021

When I run the code, it works perfectly fine with the following code: [Checked in iOS and Android device and simulators/device]


 // This will take screenshot of 'previewContainer' child widget and share it
  _takeScreenShot() async {
    try {
      RenderRepaintBoundary boundary = previewContainer.currentContext.findRenderObject();
      if (boundary.debugNeedsPaint) {
        print("Waiting for boundary to be painted.");
        await Future.delayed(const Duration(milliseconds: 20));
        return _takeScreenShot();
      }
      ui.Image image = await boundary.toImage(pixelRatio: 3.0);
      final directory = (await getApplicationDocumentsDirectory()).path;
      ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png);
      Uint8List pngBytes = byteData.buffer.asUint8List();

      await WcFlutterShare.share(
          sharePopupTitle: 'Screenshot',
          fileName: 'screenshot.png',
          mimeType: 'image/png',
          bytesOfFile: pngBytes);
    } on PlatformException catch (e) {
      print("PlatformException while taking screenshot :" + e.toString());
    } catch (other) {
      print("Exception while taking screenshot:" + other.toString());
    }
  }
 

But the same code doesn't work after creating IPA and install it on the device. - didn't check with an Android device.

@aarajput
Copy link
Owner

aarajput commented May 9, 2021

I will look into it day after tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants