5

I'm trying to post an image with hashtag to facebook using react-native-fbsdk(0.4.0) like this:

ShareDialog.canShow(shareContent)
  .then(canShow => {
    if (canShow) {
      return ShareDialog.show(shareContent);
    } else {
      return Promise.reject('error sharing');
    }
 })
 .then(result => {
   // evaluating result here
 });

Share dialog appears normally and content is posted to FB when shareContent has the following content:

shareContent = {
  contentType: 'photo',
  photos: [{
    imageUrl: 'valid uri'
  }]
};

When I add a hashtag, share dialog doesn't appear and result is an empty object {}:

shareContent = {
  contentType: 'photo',
  commonParameters: {
    hashtag: '#SomeHashTag'
  },
  photos: [{
    imageUrl: 'the same valid uri'
  }]
};

Also if I try to add a hashtag to other types like link share dialog works fine.

What I am doing wrong? :(

Ninten
  • 565
  • 3
  • 10
  • I've an external image URL. How do I convert it into a local URI to send using Facebook Share? – Pavan Jan 09 '18 at 12:18
  • Did you find out how? When I use "#myhashtag" the dialog doesn't open, when I use "myhashtag" the hashtag doesn't show up in the dialog or in the shared content later... – K.. Mar 13 '18 at 11:34

1 Answers1

1

I've got the same problem. I wrote printF for displaying what happens inside FBSDKSharePhoto. And I noticed next info:

canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"

Then I've googled this question and install facebook app on Iphone and loggedIn (you can't install facebook on emulator device you need use real device for this) And it works for me.

Vendicto
  • 95
  • 8