appinioGmbH / flutter_packages

Dart and Flutter plugins/packages used and maintained by @appinioGmbH
187 stars 214 forks source link

Social share: Images/Sticker etc. are not shown in instagram story #74

Closed jakobheb closed 1 year ago

jakobheb commented 1 year ago

The images are not shown and a grey screen appears in the story section.

Any ideas how to solve that

Future<void> shareToInstagram(String message, String filePath) async { await appinioSocialShare.shareToInstagramStory(backgroundImage: "assets/restaurants/habaneros.jpg", backgroundBottomColor: "", backgroundTopColor: "", backgroundVideo: "", stickerImage: ""); }

khanmujeeb687 commented 1 year ago

Hey @jakobheb , you have to pass the image path from your device's storage not the asset path.

you can use image picker or any other plugin to pick media from the device or capture a pic and share.

jakobheb commented 1 year ago

Even if I add the absolute path of an image, it is showing black screen

khanmujeeb687 commented 1 year ago

Hey @jakobheb , I tried to reproduce it but it worked fine for me.

Could you please try using the below code and make sure the issue is in social share plugin.


    XFile? xFile = await ImagePicker.platform.getImage(
      source: ImageSource.gallery,
    );
    if (xFile != null) {
      String path = xFile.path;
      shareToInstagram(path);
    }
  }

  Future<void> shareToInstagram(String filePath) async {
    await appinioSocialShare.shareToInstagramStory(
      backgroundImage: filePath,
      stickerImage: filePath,
    );
  }