2016-11-15 1 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); 
} 

는 사파리 웹보기에서 열립니다 때 내가 설치 한 페이스 북 앱 장치에로드 할 때이 코드는 시뮬레이터에서 작동, 그것은 이상의 모델을 엽니 다 : 내 코드는 다음처럼 설정있어 내 응용 프로그램하지만 그것을 제공하는 URL을 사용하는 다음 내 코드를 사용하는 대신 페이지의 메타 태그에서 다른 모든 데이터를 채 웁니다. 이 앱이 기본 앱에서 작동하도록하기 위해해야 ​​할 일이 있습니까?

enter image description here enter image description here . 아이폰 OS 10

, 반응 네이티브 0.30.0, 반응 - 네이티브 fbsdk

답변

1

0.4.0 나는 같은 문제가 있습니다. 내 솔루션은 ShareDialog 대신 ShareButton을 사용하는 것입니다. 그것은 내 아이폰 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

관련 문제