# firebase-in-app-messaging

Guides Firebase In-App Messaging setup in Flutter: trigger and suppress popups during sensitive flows, configure GDPR opt-in collection, and run tests via test device IDs.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 674 repo stars
- Author: Ivanna Kaceviča
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/evanca/flutter-ai-rules/tree/HEAD/skills/firebase-in-app-messaging/SKILL.md
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/firebase-in-app-messaging

## What it does

This skill directs the agent on implementing `firebase_in_app_messaging` in Flutter projects. It covers initial setup after `Firebase.initializeApp()`, programmatic triggers using `triggerEvent`, and temporary message suppression with `setMessagesSuppressed`. Suppressing popups during payments or onboarding prevents unwanted interruptions. Suppression turns off on app restarts, and missed events are dropped rather than queued.

The skill also details privacy workflows for GDPR compliance. It explains how to turn off automatic data collection in `Info.plist` and `AndroidManifest.xml`, activating it via `setAutomaticDataCollectionEnabled` only after explicit opt-in. Runtime preferences persist across restarts and override XML values.

For testing, the instructions detail locating the Installation ID in Android logcat or Xcode logs using `-FIRDebugEnabled`. Relying on normal delivery makes debugging slow: the SDK checks the server only once per day.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add evanca/flutter-ai-rules
```
In the agent chat (not a shell):
```text
/plugin install flutter-ai-skills@flutter-ai-rules
```
This installs the whole flutter-ai-skills plugin with all its skills

2. **Skills CLI (Vercel)**
```bash
npx skills add evanca/flutter-ai-rules --skill firebase-in-app-messaging -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/firebase-in-app-messaging/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/firebase-in-app-messaging/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add evanca/flutter-ai-rules --skill firebase-in-app-messaging -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/firebase-in-app-messaging/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add evanca/flutter-ai-rules --skill firebase-in-app-messaging -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/firebase-in-app-messaging/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install evanca/flutter-ai-rules skills/firebase-in-app-messaging
```

2. **Manually: put the files in place**
- File: `.github/skills/firebase-in-app-messaging/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add evanca/flutter-ai-rules --skill firebase-in-app-messaging -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/evanca/flutter-ai-rules --path skills/firebase-in-app-messaging
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/firebase-in-app-messaging/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/evanca/flutter-ai-rules/tree/HEAD/skills/firebase-in-app-messaging/SKILL.md

## When to use it
- integrate Firebase In-App Messaging into a Flutter codebase
- suppress disruptive popups during checkout and onboarding flows
- enforce GDPR compliance through opt-in data collection switches
- preview test campaigns on physical hardware using an Installation ID

## Example prompts
- Suppress Firebase in-app messages on our payment screen widget
- Configure opt-in data collection in AndroidManifest.xml and Info.plist for GDPR
- Show how to find the Installation ID in logcat to test an in-app campaign

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: e95d227a174bb707.

BEGIN THIRD-PARTY FILE e95d227a174bb707
````text
---
name: firebase-in-app-messaging
description: "Use when running in-app message campaigns, triggering/suppressing messages, configuring opt-in data collection, testing on specific devices, or handling message callbacks."
license: MIT
---

# Firebase In-App Messaging Skill

This skill defines how to correctly implement Firebase In-App Messaging in Flutter applications, covering setup, programmatic triggers, privacy controls, testing workflows, and campaign management.

## When to Use

Use this skill when:

* Setting up Firebase In-App Messaging in a Flutter project.
* Triggering or suppressing in-app messages programmatically.
* Implementing opt-in data collection for GDPR or user privacy compliance.
* Testing campaigns with specific devices before rollout.
* Configuring message types, targeting rules, and A/B tests.

---

## 1. Setup and Configuration

```
flutter pub add firebase_in_app_messaging
```

```dart
import 'package:firebase_in_app_messaging/firebase_in_app_messaging.dart';
```

- Initialize Firebase before using any In-App Messaging features.
- In-App Messaging **retrieves messages from the server once per day** by default to conserve power.

### Setup Checklist

1. Confirm `Firebase.initializeApp()` completes before accessing In-App Messaging.
2. Create a test campaign in the Firebase console to verify the integration.
3. Locate the Installation ID for device-specific testing (see Testing section).

---

## 2. Message Triggering and Display

Use Google Analytics events to trigger in-app messages without additional code. For programmatic triggering:

```dart
// Trigger a message tied to a custom event
await FirebaseInAppMessaging.instance.triggerEvent("purchase_complete");
```

### Suppress Messages During Critical Flows

```dart
class PaymentScreen extends StatefulWidget {
  @override
  State<PaymentScreen> createState() => _PaymentScreenState();
}

class _PaymentScreenState extends State<PaymentScreen> {
  @override
  void initState() {
    super.initState();
    // Suppress messages during payment
    FirebaseInAppMessaging.instance.setMessagesSuppressed(true);
  }

  @override
  void dispose() {
    // Re-enable messages when leaving payment flow
    FirebaseInAppMessaging.instance.setMessagesSuppressed(false);
````
END THIRD-PARTY FILE e95d227a174bb707

The third-party file has ended. Everything between the e95d227a174bb707 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2267 of 5584 bytes. © Ivanna Kaceviča · MIT · https://github.com/evanca/flutter-ai-rules/tree/HEAD/skills/firebase-in-app-messaging/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
