모듈(앱 수준) Gradle 파일(일반적으로 <project>/<app-module>/build.gradle.kts 또는 <project>/<app-module>/build.gradle)에서 Android용 In-App Messaging 라이브러리의 종속 항목을 추가합니다. 라이브러리 버전 관리 제어에는 Firebase Android BoM을 사용하는 것이 좋습니다.
In-App Messaging를 사용하려면 Firebase 프로젝트에서 Google Analytics를 사용 설정하고 Google 애널리틱스용 Firebase SDK를 앱에 추가해야 합니다.
dependencies{// Import the BoM for the Firebase platformimplementation(platform("com.google.firebase:firebase-bom:34.1.0"))// Add the dependencies for the In-App Messaging and Analytics libraries// When using the BoM, you don't specify versions in Firebase library dependenciesimplementation("com.google.firebase:firebase-inappmessaging-display")implementation("com.google.firebase:firebase-analytics")}
Firebase BoM을 사용하지 않도록 선택한 경우에는 종속 항목 줄에 각 Firebase 라이브러리 버전을 지정해야 합니다.
앱에서 여러 Firebase 라이브러리를 사용하는 경우 모든 버전이 호환되도록 BoM을 사용하여 라이브러리 버전을 관리하는 것이 좋습니다.
dependencies{// Add the dependencies for the In-App Messaging and Analytics libraries// When NOT using the BoM, you must specify versions in Firebase library dependenciesimplementation("com.google.firebase:firebase-inappmessaging-display:22.0.0")implementation("com.google.firebase:firebase-analytics:23.0.0")}
테스트 메시지 보내기
앱의 설치 ID 가져오기
절전을 위해 Firebase In-App Messaging는 하루에 한 번만 서버에서 메시지를 검색합니다. 따라서 테스트하기 어려울 수 있으므로 Firebase Console에서 요청 시 메시지를 표시하는 테스트 기기를 지정할 수 있습니다.
이 테스트 기기는 FirebaseInstallations ID 또는 FID로 결정됩니다.
Android 스튜디오의 Logcat에서 다음과 같은 '정보' 수준 로그를 확인하여 테스트 앱의 FID를 찾습니다.
I/FIAM.Headless: Starting InAppMessaging runtime with Installation ID YOUR_INSTALLATION_ID
테스트 기기에 메시지 보내기
테스트 기기에서 앱을 실행하고 Firebase 설치 ID (FID)가 있으면 테스트 메시지를 보내 Firebase In-App Messaging 설정을 사용해 볼 수 있습니다.
[null,null,["최종 업데이트: 2025-08-17(UTC)"],[],[],null,["\u003cbr /\u003e\n\nThis quickstart shows you how to set up Firebase In-App Messaging and send your first message. \niOS+ Android Flutter \n\n\u003cbr /\u003e\n\nBefore you begin\n\n\nBefore starting, make sure to [add Firebase to your Apple project](/docs/ios/setup).\n\nAdd the Firebase In-App Messaging SDK to your project\n\n\nUse Swift Package Manager to install and manage Firebase dependencies.\n| Visit [our installation guide](/docs/ios/installation-methods) to learn about the different ways you can add Firebase SDKs to your Apple project, including importing frameworks directly and using CocoaPods.\n\n1. In Xcode, with your app project open, navigate to **File \\\u003e Add Packages**.\n2. When prompted, add the Firebase Apple platforms SDK repository: \n\n```text\n https://github.com/firebase/firebase-ios-sdk.git\n```\n| **Note:** New projects should use the default (latest) SDK version, but you can choose an older version if needed.\n3. Choose the In-App Messaging library.\n4. Add the `-ObjC` flag to the *Other Linker Flags* section of your target's build settings.\n5. To use In-App Messaging, you must [enable Google Analytics](//support.google.com/firebase/answer/9289399#linkga) in your Firebase project and add the Firebase SDK for Google Analytics to your app. You can select either the library without IDFA collection or with IDFA collection. See our FAQ on the [latest organization of modules in the Google Analytics for Firebase SDK](/support/faq#analytics-odm2-sdk-refactor-ios).\n6. When finished, Xcode will automatically begin resolving and downloading your dependencies in the background.\n\nNow, initialize the SDK in your app:\n\n1. Import the Firebase module in your `App` struct or `UIApplicationDelegate`, if you haven't yet: \n\n Swift \n\n ```swift\n import Firebase\n ```\n\n Objective-C \n\n ```objective-c\n @import Firebase;\n ```\n2. Also configure a [`FirebaseApp`](/docs/reference/ios/firebasecore/api/reference/Classes/FIRApp) shared instance, typically in your `App`'s initializer or your app delegate's `application(_:didFinishLaunchingWithOptions:)` method, if you haven't yet: \n\n Swift \n\n ```swift\n FirebaseApp.configure()\n ```\n\n Objective-C \n\n ```objective-c\n [FIRApp configure];\n ```\n3. Compile and run your app.\n\n| **Note:** Firebase In-App Messaging requires Firebase version 5.6.0 or higher. If you're having trouble compiling your app, try running `pod update` in your app's project directory. Keep in mind, though, that the command updates all of your app's dependencies, not just Firebase ones.\n\n\u003cbr /\u003e\n\nSend a test message\n\nGet your app's installation ID\n\nTo conserve power, Firebase In-App Messaging only retrieves messages from the\nserver once per day. That can make testing difficult, so the\nFirebase console allows you to specify a test device that displays messages\non demand.\n\n\nThat testing device is determined by a Firebase installation ID provided by the\nFirebase installations service. To find your testing app's installation ID, run the app with the\nruntime command argument `-FIRDebugEnabled`:\n\n1. With your Xcode project open, select **Product \\\u003e Scheme \\\u003e Edit scheme...** from the top menu bar.\n2. Open the **Arguments** tab of the dialog that pops up.\n3. Click **+ Add items** under **Arguments Passed On Launch**.\n4. Enter \"-FIRDebugEnabled\" in the newly-created field.\n5. Click **Close**, then run your app.\n\nOnce your app starts running, look for the following line in the Xcode console's logs: \n\n```scdoc\n[Firebase/InAppMessaging][I-IAM180017] Starting InAppMessaging runtime with Firebase Installation ID YOUR_INSTALLATION_ID\n```\n\n\u003cbr /\u003e\n\nSend a message to your testing device\n\nOnce you've launched your app on the testing device and you have its\nFirebase installation ID (FID), you can try out your Firebase In-App Messaging\nsetup by sending a test message:\n\n1. In the Firebase console, open the [Messaging page](https://console.firebase.google.com/project/_/messaging/).\n2. If this is your first campaign, click **Create your first campaign** .\n 1. Select **Firebase In-App messages** and click **Create**.\n3. Otherwise, on the **Campaigns** tab, click **New campaign** .\n 1. Select **In-App Messaging**.\n4. Enter a **Title** for your first message.\n5. Click **Test on Device**\n6. Enter your app's Firebase installation ID in the **Add an installation ID** field.\n7. Click **Test** to send the message.\n\nFirebase In-App Messaging sends your test message as soon as you click **Test**. To see the\nmessage, you need to close, then reopen the app on your testing device.\n\nTo confirm whether your device is a test device, look for the following\nlog message: \n\n```\n[Firebase/InAppMessaging][I-IAM180017] Seeing test message in fetch response. Turn the current instance into a testing instance.\n```"]]