分享到 Instagram 故事永远无法解决承诺

时间:2021-04-14 15:07:51

标签: react-native

任何有使用 https://github.com/react-native-share lib 在 Instagram 上分享故事经验的人都可以帮助我吗?如果我尝试分享图片,它会成功分享到 Instagram,但承诺永远不会解决:(。仅在 iOS 上运行。 任何想法,任何人,谢谢:)

我拥有的代码片段:


   (async () => {
      const options = {
        method: Share.InstagramStories.SHARE_BACKGROUND_IMAGE,
        social: Share.Social.INSTAGRAM_STORIES,
        backgroundImage: uri,
      };

      try {
        const res =  await Share.shareSingle(options);

        console.log({res}, 'Never happen');
      } catch (err) {
        console.log({err}, 'Also never happen');
      }
   })()  

1 个答案:

答案 0 :(得分:0)

我无法解决直接发布到 Instagram Stories 的问题,而是打开 Instagram,让用户在应用内显示以选择 Feed 或 Story,这对我来说很好。

 (async () => {
    const options = {
      social: Share.Social.INSTAGRAM,
      url: imageBase64
    };

    const res = await Share.shareSingle(options);
    console.log({res})
})()