Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 991
Ninten Avatar asked Nov 09 '22 04:11

Ninten


1 Answers

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.

like image 65
Vendicto Avatar answered Nov 15 '22 14:11

Vendicto