LoginSignup
shige8
@shige8

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

[ReactNative]Twitterでloginし、firebaseでuserを作りたい

解決したいこと

服薬習慣化アプリを作っています。

Twitterでloginしたいのですが、できません。

発生している問題・エラー

TypeError: null is not an object (evaluating 'RNTwitterSignIn.init')

該当するソースコード

const { RNTwitterSignIn } = NativeModules;

  const onTwitterButtonPress = async () =>  {
      await RNTwitterSignIn.init(
        process.env.TWITTER_CONSUMER_KEY,
        process.env.TWITTER_CONSUMER_SECRET
      ).then(() => console.log("Twitter SDK initialized"));
    // Perform the login request
    const { oauthToken, oauthTokenSecret } = await RNTwitterSignIn.logIn();

    // Create a Twitter credential with the tokens
    const twitterCredential = auth.TwitterAuthProvider.credential(
      oauthToken,
      oauthTokenSecret
    );

    // Sign-in the user with the credential
    return auth().signInWithCredential(twitterCredential);
  }

自分で試したこと

TwitterAPIは認証され、APIkey,APIsecretkeyは取得できています。上記を参考にしたのですが、うまくいきません。

こちらのライブラリをインストールしているのですが、

実際のTweetAppsの画面はこちらで
スクリーンショット 2022-05-15 17.02.13.png

上記のページでは
スクリーンショット 2022-05-15 17.05.05.png

この画面で設定するとなっていますが、変更?されているようです。これが原因なのかが分かりません。

何かヒントをいただけたら、幸いです。

0

No Answers yet.

Your answer might help someone💌