ShekarMudaliyar / social_share

Flutter package to share images/videos/text on social media
https://pub.dev/packages/social_share
MIT License
108 stars 180 forks source link

shareInstagramStory fail #66

Open mzl1988 opened 3 years ago

mzl1988 commented 3 years ago
SocialShare.shareInstagramStory(
      '/var/mobile/Containers/Data/Application/E6876F8D-59A0-4D8B-9D74-937100C35777/Library/Cachesscreen_shot.png',
      attributionURL: 'https://www.google.com',
    ).then((data) {
      print(data);
    });

image

pa2codes commented 3 years ago

Same error for me. When trying to call SocialShare.shareInstagramStory the App crashs with same error as for @mzl1988

workthoselegs commented 3 years ago

Same for me, this is the error from running within xcode. Does anyone know how to resolve this?

2021-05-17 14:14:05.528485+0200 Runner[76150:14349957] -[NSNull length]: unrecognized selector sent to instance 0x1f0afdee0 2021-05-17 14:14:05.532048+0200 Runner[76150:14349957] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x1f0afdee0' First throw call stack: (0x19f5e19d8 0x1b3964b54 0x19f4f1bbc 0x19f5e401c 0x19f5e5f8c 0x103f07658 0x104810694 0x103fb0038 0x1042af41c 0x10424e81c 0x104250ed4 0x19f5623e0 0x19f561fe4 0x19f5614c4 0x19f55b850 0x19f55aba0 0x1b62c0598 0x1a1e4c2f4 0x1a1e51874 0x102873be4 0x19f239568) libc++abi.dylib: terminating with uncaught exception of type NSException *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x1f0afdee0' terminating with uncaught exception of type NSException

yelkamel commented 3 years ago

I have the same error even after upgrading the instagram application. On iOS only, Android is working.

fmatera-duckma commented 3 years ago

same problem on iOS

Babwenbiber commented 3 years ago

This definitely needs a fix. However, you can work around it if you use a background image some background colors. For me I just grabbed a black image and set any colors.

SocialShare.shareInstagramStory(
        filePath,
        backgroundImagePath: await ImageUtils.imageToFilePath(
            "images/background/black_background.jpg"),
        attributionURL: "https://deep-link-url",
        backgroundBottomColor: "FFFFFF",
        backgroundTopColor: "FFFFFF",
      );

Note, that the ImageUtils is a custom Class and is needed only for my needs, because I customized the library for my needs.

lost-codee commented 3 years ago

same on iOS 13

JessicaShalomG commented 3 years ago

same problem, working for android but not for ios

nino-finch commented 3 years ago

I also run into this issue and the solution from @Babwenbiber doesn't work for me.

silvio-87 commented 3 years ago

This definitely needs a fix. However, you can work around it if you use a background image some background colors. For me I just grabbed a black image and set any colors.

SocialShare.shareInstagramStory(
        filePath,
        backgroundImagePath: await ImageUtils.imageToFilePath(
            "images/background/black_background.jpg"),
        attributionURL: "https://deep-link-url",
        backgroundBottomColor: "FFFFFF",
        backgroundTopColor: "FFFFFF",
      );

Note, that the ImageUtils is a custom Class and is needed only for my needs, because I customized the library for my needs.

I had the same problem. With this trick I solved it. Thank you

jkronlachner commented 3 years ago

This has been fixed in pull req #68

@ShekarMudaliyar could you upload a new version to pub.dev?

jkronlachner commented 3 years ago

A hotfix is to directly use the github repo:

social_share: git: https://github.com/ShekarMudaliyar/social_share.git