# Firebaseサービスの設定

## Androidの設定

ニフクラ mobile backendで利用している設定ファイル (google-services.json) があるため、Firebaseの追加設定は必要ありません。

設定ファイルがない場合は、こちらの手順をもとにアプリの登録と設定ファイルの作成をしてください。

{% content-ref url="/pages/BZjcvmFpwvJzEpCtSFue" %}
[アプリの登録と設定ファイルの取得](/external-service-integration-guide/firebase/app-registration.md)
{% endcontent-ref %}

***

## iOSの設定

iOSでは、次の手順でFirebaseサービスの設定を行います。

1. Firebaseコンソールでの設定ファイル(GoogleService-Info.plist)の作成
2. ニフクラモバイルバックエンドから証明書(p12)をエクスポート
3. 証明書をFirebaseへインポート

### Firebaseでの設定ファイル(GoogleService-Info.plist)の作成

下の手順を参考にFirebase上へのiOSアプリの登録と設定ファイルの作成を行います。

{% content-ref url="/pages/BZjcvmFpwvJzEpCtSFue" %}
[アプリの登録と設定ファイルの取得](/external-service-integration-guide/firebase/app-registration.md)
{% endcontent-ref %}

### ニフクラモバイルバックエンドから証明書(p12)をエクスポート

1. ニフクラ mobile backendで対象のプロジェクトを開き、右上の**アプリ設定**をクリックします。

   <figure><img src="/files/6DDcd5UV8cLSYyPX4ZWO" alt="" width="563"><figcaption></figcaption></figure>
2. 左側に表示されたサイドメニューから、**プッシュ通知**を選択します。
3. 「iOSプッシュ通知(p12)」セクションから、既に登録されてあるiOSプッシュ通知の**ダウンロード**ボタン押して証明書をエクスポートします。<br>

   <figure><img src="/files/DAoajM0YaUxbQ20bXz67" alt="" width="563"><figcaption></figcaption></figure>

### 証明書をFirebaseへインポート

1. Firebaseにアクセスし、対象のプロジェクトを開きます。
2. 左上の設定ボタンをクリックし、**プロジェクトの設定**にアクセスします。<br>

   <figure><img src="/files/qnFKdYyqMeOCsErEJhN8" alt="" width="375"><figcaption></figcaption></figure>
3. プロジェクトの設定から、「Cloud Messaging」 タブをクリック
4. Appleのアプリ構成セクションにあるAPNｓ証明書の**アップロード**ボタンから証明書をアップロードします。<br>

   <figure><img src="/files/uSs8nhDc6KBmyjOoDYrj" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ja.docs.monaca.io/migration-guide/nifcloud/push/setup-firebase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
