flutter google_sign_in サンプルがうまく動かない。

ご回答、よろしくお願いいたします。

実現したいこと

  • flutterのiosにおいてgoogle_sign_inパッケージを用い、google認証を行いたい。

→firebaseのauthenticationにユーザー登録をgoogle_sign_inから行いたい。

前提

ー行ったことー
・google_sign_inのパッケージ(https://pub.dev/packages/google_sign_in)
のサンプルコードを丸コピ

・readmeに従事
※以下二つは行っていない。

7,If you need to authenticate to a backend server you can add a SERVER_CLIENT_ID key value pair in your GoogleService-Info.plist.

<key>SERVER_CLIENT_ID</key> <string>[YOUR SERVER CLIENT ID]</string>

As an alternative to adding GoogleService-Info.plist to your Xcode project, you can instead configure your app in Dart code. In this case, skip steps 3 to 7 and pass clientId and serverClientId to the GoogleSignIn constructor:

GoogleSignIn _googleSignIn = GoogleSignIn( ... // The OAuth client id of your app. This is required. clientId: ..., // If you need to authenticate to a backend server, specify its OAuth client. This is optional. serverClientId: ..., );

発生している問題・エラーメッセージ

google_sign_inパッケージの画面(ログインボタン、googleアカウント選択)は想定されたものが表示される。
しかし、肝心のfirebase側での登録及びサインインができない。

なお、androidstudio上のterminal及び、logcatからはエラーメッセージは表示されていない。

該当のソースコード

サンプルコードそのままなので割愛。

試したこと

公式の手順で漏れがないか確認したくらい。

補足情報(FW/ツールのバージョンなど)

pubspec.yaml

dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 google_sign_in: ^6.0.1

IDE:Android studio

コメントを投稿

0 コメント