Skip to content

In-App Messaging - #14

Merged
kengoon merged 1 commit into
mainfrom
feat/in-app-messaging
Nov 12, 2026
Merged

kengoon merged 1 commit into
mainfrom
feat/in-app-messaging

Conversation

@kengoon

@kengoon kengoon commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Wraps Firebase In-App Messaging (pyios_firebase.in_app_messaging), a separate product from Cloud Messaging.

  • InAppMessaging.in_app_messaging():
    • message_display_suppressed, automatic_data_collection_enabled, trigger_event(name)
    • impression / click / dismiss / error listeners, through a Python FIRInAppMessagingDisplayDelegate
  • Typed messages:
    • ModalMessage, BannerMessage, CardMessage, ImageOnlyMessage
    • CampaignInfo, ImageData (with the downloaded bytes), ActionButton, Action
    • colors are "#RRGGBB" strings; the campaign's custom data is in app_data
  • set_display(handler) shows messages with Python (for example a Kivy popup):
    • a DisplayDelegate reports the impression, then exactly one click, dismiss or failure;
    • a handler that raises marks the message as failed, so Firebase does not wait on it forever.
    • use_default_display() restores Firebase's screens.
  • Python exceptions where the SDK would misbehave quietly:
    • in_app_messaging() before configure raises RuntimeError (the SDK returns nil);
    • an empty event name raises ValueError;
    • finishing a message twice raises RuntimeError.
  • Docs:
    • a usage page with App configuration, triggers, listeners, a custom Kivy display and testing on a device;
    • a reference page;
    • the getting-started tables.
  • README additions.

Tests

  • 941 unit tests pass; mypy (strict), pyright and ruff are clean; mkdocs build --strict passes.
  • iOS e2e on the Simulator: 86 passed, 0 failed, 1 skipped (the skip already existed). The new tests cover:
    • the settings and trigger_event checks;
    • a Python display called the way Firebase calls it;
    • Firebase's default modal (FIRIAMDefaultDisplayImpl) shown over the Kivy window, with its impression (after 3 s on screen) and a tap on its real button reaching the listeners.
  • Not covered: a real campaign fetched from the console. There is no emulator, and the e2e project is offline.

🤖 Generated with Claude Code

pyios_firebase.in_app_messaging wraps Firebase In-App Messaging:

- InAppMessaging: message_display_suppressed, automatic_data_collection_enabled,
  trigger_event (checked), and impression / click / dismiss / error listeners
  through a Python FIRInAppMessagingDisplayDelegate
- typed messages: ModalMessage, BannerMessage, CardMessage, ImageOnlyMessage,
  with CampaignInfo, ImageData, ActionButton, Action; colors as "#RRGGBB"
- set_display(handler): show messages with Python (a Kivy popup) through a
  DisplayDelegate that reports impression, click, dismiss or failure once;
  a raising handler fails the message so Firebase does not wait forever.
  use_default_display() restores Firebase's screens
- in_app_messaging() before configure raises RuntimeError (the SDK gives nil)

Unit tests, the typing check, docs pages (usage and reference), README
additions, and e2e tests: settings, a Python display called as Firebase calls
it, and Firebase's default modal over the Kivy window with its impression and
a tap on its button reaching the listeners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, approving this one — thanks so much!

Produced by Air Automations. Name: Code Review / Run: https://air.jetbrains.cloud/org/a114b0a9-2e82-18ec-abd3-29d0c8a05e2d/automations/c07b9901-fe4e-417d-ae1d-e00c83e39e4c?run=b7b862bf-e2d2-4fdd-8b4d-5f094ce81720

@kengoon
kengoon merged commit 71b24ba into main Nov 12, 2026
4 checks passed
@kengoon
kengoon deleted the feat/in-app-messaging branch November 12, 2026 13:14
@kengoon kengoon mentioned this pull request Nov 12, 2026
kengoon added a commit that referenced this pull request Nov 12, 2026
Since 0.2.1:
- In-App Messaging: pyios_firebase.in_app_messaging, with settings, event
  triggers, impression / click / dismiss / error listeners, typed messages,
  and set_display() to show messages with Python (#14)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant