Ninten
Ninten

Reputation: 565

React Native Post image with hashtag to facebook

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? :(

Upvotes: 5

Views: 1150

Answers (1)

Vendicto
Vendicto

Reputation: 95

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.

Upvotes: 1

Related Questions