コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Firebase Cloud Messaging
plat_ios
plat_android
plat_web
plat_flutter
plat_cpp
plat_unity
Firebase Cloud Messaging(FCM)は、メッセージを確実に送信するためのクロス プラットフォーム メッセージング ソリューションです。
FCM を使用すると、同期可能な新しいメールやその他のデータがあることをクライアント アプリに通知できます。通知メッセージを送信することで、ユーザーにアプリを再度アピールし、定着率の向上につなげることができます。インスタント メッセージなどの用途では、メッセージで最大 4,096 バイトのペイロードをクライアント アプリに転送することも可能です。
準備ができたらプラットフォームを選択します。
iOS+
Android
ウェブ
Flutter
Unity
C++
主な機能
通知メッセージまたはデータ メッセージの送信 |
ユーザーに対して表示される通知メッセージを送信します。
または、データ メッセージを送信して、アプリケーション コードで行われている処理を詳細に確認できます。メッセージのタイプをご覧ください。 |
汎用性の高いメッセージのターゲット設定 |
クライアント アプリへのメッセージ配信を 3 つの方法(個々のデバイスに、デバイス グループに、または特定トピックの配信登録をしているデバイスに)で行うことができます。
|
仕組み
FCM の実装には、送信と受信のために以下の 2 つの主要コンポーネントが含まれています。
- メッセージの作成、ターゲティング、送信を行う Cloud Functions for Firebase やアプリサーバーなどの信頼できる環境。
- 対応するプラットフォーム固有のトランスポート サービスを介してメッセージを受信する Apple、Android、またはウェブ(JavaScript)クライアント アプリ。
メッセージは、Firebase Admin SDK または FCM サーバー プロトコルを介して送信できます。Notifications Composer を使うと、送信テストをしたり、組み込まれている強力なターゲティング機能や分析機能、またはカスタムのインポートしたセグメントを利用して、マーケティングやエンゲージメント目的のメッセージを送信したりできます。
FCM のコンポーネントの詳細と重要な情報については、アーキテクチャの概要をご覧ください。
実装パス
|
FCM SDK を設定する |
ご使用のプラットフォームに応じた設定手順に沿って、アプリに Firebase と FCM を設定します。 |
|
クライアント アプリを開発する |
メッセージ処理、トピック サブスクリプション ロジック、その他のオプション機能をクライアント アプリに追加します。開発中は、Notifications Composer からテスト メッセージを簡単に送信できます。 |
|
アプリサーバーを開発する |
送信ロジック(認証、送信リクエストの作成、応答の処理などを行うロジック)を作成するために、Firebase Admin SDK を使用するか、またはサーバー プロトコルを使用するかを決定します。次に、信頼できる環境でロジックを構築します。 |
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-19 UTC。
[null,null,["最終更新日 2025-08-19 UTC。"],[],[],null,["Firebase Cloud Messaging \nplat_ios plat_android plat_web plat_flutter plat_cpp plat_unity \nFirebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably send\nmessages. \nUsing FCM, you can notify a client app that new email or other data is available to sync. You can send notification messages to drive user re-engagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4096 bytes to a client app.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nReady to get started? Choose your platform:\n\n[iOS+](/docs/cloud-messaging/ios/client)\n[Android](/docs/cloud-messaging/android/client)\n[Web](/docs/cloud-messaging/js/client)\n[Flutter](/docs/cloud-messaging/flutter/client)\n\n[Unity](/docs/cloud-messaging/unity/client)\n[C++](/docs/cloud-messaging/cpp/client)\n\nKey capabilities\n\n|---------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Send notification messages or data messages | Send notification messages that are displayed to your user. Or send data messages and determine completely what happens in your application code. See [Message types](/docs/cloud-messaging/concept-options#notifications_and_data_messages). |\n| Versatile message targeting | Distribute messages to your client app in any of 3 ways---to single devices, to groups of devices, or to devices subscribed to topics. |\n\nHow does it work?\n\n\u003cbr /\u003e\n\nAn FCM implementation includes two main components for\nsending and receiving:\n\n1. A trusted environment such as Cloud Functions for Firebase or an app server on which to build, target, and send messages.\n2. An Apple, Android, or web (JavaScript) client app that receives messages via the corresponding platform-specific transport service.\n\n\u003cbr /\u003e\n\nYou can send messages via\nthe [Firebase Admin SDK](/docs/cloud-messaging/server#firebase-admin-sdk-for-fcm) or the\n[FCM server protocol](/docs/cloud-messaging/server#choose).\nYou can use [the Notifications composer](//console.firebase.google.com/project/_/notification) for testing and to send marketing or engagement\nmessages using powerful built-in targeting and analytics or custom\n[imported segments](/docs/projects/import-segments).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nSee the [architectural\noverview](/docs/cloud-messaging/fcm-architecture) for more detail and important\ninformation about the components of FCM.\n\n\u003cbr /\u003e\n\nImplementation path\n\n|---|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | Set up the FCM SDK | Set up Firebase and FCM on your app according to the setup instructions for your platform. |\n| | Develop your client app | Add message handling, topic subscription logic, or other optional features to your client app. During the development, you can easily send test messages from [the Notifications composer](//console.firebase.google.com/project/_/notification). |\n| | Develop your app server | Decide whether you want to use the Firebase Admin SDK or the server protocol to create your sending logic---logic to authenticate, build send requests, handle responses, and so on. Then build out the logic in your trusted environment. |\n\nNext steps\n\n- Run the [Android](https://github.com/firebase/quickstart-android/tree/master/messaging)\n or [iOS](https://github.com/firebase/quickstart-ios/tree/master/messaging/)\n Quickstart sample. These samples let you run and review code to send a test\n message to a single device using the Firebase console.\n\n- Learn more about FCM from the\n [architecture overview](/docs/cloud-messaging/fcm-architecture),\n guides to key [FCM concepts](/docs/cloud-messaging/concept-options),\n and best practices guides for [sending messages at scale](/docs/cloud-messaging/scale-fcm)\n and [managing registration tokens](/docs/cloud-messaging/manage-tokens).\n\n- Try the tutorials for [Android](/docs/cloud-messaging/android/first-message)\n or [iOS](/docs/cloud-messaging/ios/first-message).\n\n- Add Firebase Cloud Messaging to your\n [Android](/docs/cloud-messaging/android/client),\n [Apple](/docs/cloud-messaging/ios/client),\n or [Web](/docs/cloud-messaging/js/client) app.\n\n- Set up your trusted environment where you'll build and send message requests.\n You can write sending logic using the\n [Admin SDK](/docs/cloud-messaging/server#firebase-admin-sdk-for-fcm), and\n readily deploy that code on Cloud Functions for Firebase or other cloud\n environments managed by Google.\n Alternatively, you can perform server development using the\n [FCM server protocol](/docs/cloud-messaging/server#choose)."]]