2016-11-15 10 views
1

ShareDialogを使用してReact-Native-FBSDKライブラリを介してリンクを共有しようとしています。私はそうのように設定私のコードを持っている:React-Native FBSDK共有ダイアログは、シミュレータ(iOS)でのみ動作します

const shareContent = { 
    contentType: 'link', 
    contentDescription: 'Stuff here', 
    contentTitle: 'Share Title', 
    contentUrl: 'https://google.com', 
    imageUrl: someUrl 
} 

ShareDialog.canShow(shareContent).then((canShow) => { 
    canShow && ShareDialog.show(shareContent); 
} 

それはサファリのWebViewで開きますが、Facebookアプリがインストールされて、私は、デバイス上でそれをロードしたときに、それがモデルの上に開いたときに、このコードは、シミュレータで動作します私のアプリは、私はそれを与えるURLを使用して、それは私のコードを使用する代わりに、ページ上のメタタグから他のすべてのデータを入力します。これがネイティブアプリで動作するようにするために必要なことはありますか?

enter image description here enter image description here 。 iOSの10

、反応ネイティブ0.30.0、反応-ネイティブfbsdk

答えて

1

0.4.0は、私は同じ問題を持っています。私の解決策は、ShareDialogの代わりにShareButtonを使用することです。それは私のiPhone 10.2で完璧に動作します。

import {ShareButton} from "react-native-fbsdk"; 


const shareModel = { 
     contentType: 'link', 
     contentUrl: this.url, 
     contentTitle: this.title, 
     contentDescription: this.description, 
     imageUrl: this.thumb 
    }; 

<ShareButton shareContent={shareModel}/> 
+0

this.thumbの値は何ですか?それは外部のURLを許可していますか? – Pavan

関連する問題