2017-11-09 19 views
2

그래서 내가 초대 대화 상자를 보여 react-native-fbsdkFBAppInviteDialog를 사용하는 것을 시도하고 대화 오류를 초대하지만, 난 항상 Sending App Invites in a React Native app반응 - 네이티브 fbsdk의 응용 프로그램은

에서이 코드를 사용하려고했다

error

이 오류를 얻을 당신이 원하는 경우

여기 내 코드

constructor (props) { 
    super(props) 

    this.state = { 
     appInviteContent: { 
     applinkUrl: 'https://facebook.com' 
     } 
    } 
    } 
    _onPress =() => { 
    var tmp = this 
    AppInviteDialog.canShow(this.state.appInviteContent).then(
     function (canShow) { 
     if (canShow) { 
      return AppInviteDialog.show(tmp.state.appInviteContent) 
     } 
     } 
    ).then(
     function (result) { 
     if (result.isCancelled) { 
      Alert.alert('Share cancelled') 
     } else { 
      Alert.alert('Share success with postId: ' + result.postId) 
     } 
     }, 
     function (error) { 
     Alert.alert('Share fail with error: ' + error) 
     } 
    ) 
    } 

답변

0

이라는 showDialog 법과 나는 코드가 표시대로 flow 언어를 사용하고 또한

appInviteContent= { contentType: 'link', contentUrl: Platform.select({ ios: 'https://iossomething.com', android: 'https://androidsomething.com'}), contentDescription: 'Check the website!', };

: KS 먼저 예를 들어 이런 식으로 뭔가를 보여 주어야한다. 확인하십시오.