- Flutterで開発しているiOSアプリにFirebaseを導入したい
- Firebaseプロジェクトの作成方法が知りたい
「FirebaseをiOSアプリに導入するにはどうするの?」
今回はFirebaseでiOSアプリをセットアップするための方法を解説していきます。
FirebaseをiOSアプリでセットアップ
それではFirebaseをiOSアプリでセットアップする方法を解説していきます。
Firebaseプロジェクトを作成
まずはFirebaseコンソールでFirebaseプロジェクトを作成します。
» Firebaseの新規プロジェクト作成方法はこちら

FirebaseとiOSアプリを連携させる
Firebaseプロジェクトを作成したら管理画面を開き、iOSアプリのアイコンをクリックします。

すると次のような画面が開くのでアプリの登録を行なっていきます。
①のAppleバンドルIDはFlutterプロジェクトで使用しているXcodeから確認できます。
②と③は省略可能です。

AppleバンドルIDを確認するにはFlutterプロジェクト
>ios
>Runner
>Runnder.xcodeproj
をXcodeで開きます。

Xcodeを開いたら次の箇所でAppleバンドルIDをコピーしてFirebaseにペーストし「アプリを登録」をクリックします。
Xcodeは次のステップでも使用するのでまだ閉じなくて大丈夫です。

次にGoogleService-info.plist
をダウンロードしてXcodeの所定の位置に追加していきます。

GoogleService-info.plist
ファイルはRunner
>Runner
に追加します。

GoogleService-info.plist
を追加する際にオプションを聞かれるので「Copy items if needed」と「Runner」いチェックをいれ「FInish」をクリックします。

次のステップは無視して「次へ」をクリックします。

最後に「コンソールに進む」をクリックします。

iOSアプリの追加が完了すると次のようにFirebaseプロジェクトに表示されます。

参考サイト
- https://www.udemy.com/course/flutter-bootcamp-with-dart/learn/lecture/14486538#overview
- https://firebase.flutter.dev/docs/manual-installation/ios