Jobeso / react-native-story-share

Share your images to instagram and snapchat stories with react native.
107 stars 54 forks source link

Silent Fail When Sharing to Snap #42

Closed summerplaybook closed 3 years ago

summerplaybook commented 3 years ago

I've followed the readme instructions and have share to instagram working correctly on ios.

When I followed the instructions for snap, the following executes all console.logs with RNStoryShare.isSnapchatAvailable() returning true, but it doesn't open snapchat.

Any pointers?

  const openSnap = async () => {
    console.log("Open snap pressed");
    const isAvailable = await RNStoryShare.isSnapchatAvailable()
    console.log('are you being called');
    if (isAvailable) {
      console.log("Hi", isAvailable);
      RNStoryShare.shareToSnapchat({
        type: RNStoryShare.BASE64, // or RNStoryShare.FILE
        attributionLink: 'https://myproject.com',
        backgroundAsset: base64Background,
        stickerAsset: base64StickerAsset,
        captionText: 'text exemple',
        media: "photo", // or "video"
        stickerOptions: {
          height: 900,
          width: 900
        }
      });
      console.log("Hi2");
    }
  };

Expo diagnostics info:

  Expo CLI 3.27.14 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 3.1.0 - /usr/local/bin/fish
    Binaries:
      Node: 12.16.3 - /usr/local/bin/node
      Yarn: 1.22.0 - ~/.yarn/bin/yarn
      npm: 6.14.4 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.9.1 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    IDEs:
      Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~39.0.2 => 39.0.3 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: ~0.63.3 => 0.63.3 
      react-native-web: ~0.13.12 => 0.13.17 
    Expo Workflow: bare

Other info:

summerplaybook commented 3 years ago

Upon further error logging I found this. Any pointers? image

image

summerplaybook commented 3 years ago

This is what fixed it: https://github.com/Snapchat/creative-kit-sample/issues/6#issuecomment-531970242

I had to make sure my bundle id was included in the snap kit portal

Could be good to surface this in the javascript