Как твитнуть в твиттере и после твита go вернуться к приложению реакции-родной? - PullRequest
0 голосов
/ 07 января 2020

Я работаю над последней версией реакции 60 +.

Требование: Нажмите кнопку Twitter в моем приложении и go войдите в учетную запись твита и отправьте его в Твиттере. Но go вернемся к приложению реакции-нативу после твита.

Код:

tweetOnTwitter() {
  let TwitterShareURL = 'http://www.example.com/';
  let TweetContent = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.';

  if (TwitterShareURL !== undefined) {
    if (TwitterParameters.includes('?') === false) {
        TwitterParameters =
            TwitterParameters + '?url=' + encodeURI(TwitterShareURL);
    } else {
        TwitterParameters =
            TwitterParameters + '&url=' + encodeURI(TwitterShareURL);
    }
  }
  if (TweetContent !== undefined) {
    if (TwitterParameters.includes('?') === false) {
        TwitterParameters =
            TwitterParameters + '?text=' + encodeURI(TweetContent);
    } else {
        TwitterParameters =
            TwitterParameters + '&text=' + encodeURI(TweetContent);
    }
  }
  let url = 'https://twitter.com/intent/tweet' + TwitterParameters;
  Linking.openURL(url)
    .then(data => {
        console.log(data, 'Twitter Opened');
    })
    .catch(() => {
        console.log('Something went wrong');
    });
}

render() {
  return (
    <Button onPress={() => this.tweetOnTwitter()}>Twitter</Button>
  )
}

Скажите, пожалуйста, как получить ответный звонок после твита в твиттер-приложении-реактиве.

...