Firebase push notifications only when user is NOT on the messaging page (Android live, iOS coming)

Hi everyone,

I’m building a messaging app on Bubble, wrapped natively. Android is already live with Firebase Cloud Messaging (FCM), and I’m planning to add iOS soon (APNs not yet configured, so I’d rather get the architecture right now to avoid reworking everything later).

I want to replicate the standard chat-app behavior (WhatsApp / Messenger style):

  • If the recipient is not on the relevant conversation → they get a push notification.
  • If the recipient is already on the messaging page (or specifically on that conversation) → no push, the message just appears in real time.

Current setup:

  • Push via Firebase FCM on Android.
  • A workflow on “New message created” sends the notification to the recipient — unconditionally for now.

The problem:
The push is sent even when the recipient is actively reading the conversation, which feels broken.

Approaches I’m considering:

  1. Store a Current conversation field (reference) on the User, updated on page load / page change, cleared on exit.
  2. Add a Last seen (date) field, refreshed via a recurring workflow every ~15-30s while the user is on the page — to handle the case where the app is killed without triggering a clean unload.
  3. Gate the FCM send on: Recipient's Current conversation is not Current Conversation OR Recipient's Last seen < now - 30 seconds.

My questions:

  • Is this approach (Current conversation + Last seen) the standard Bubble pattern, or is there a cleaner / less workload-heavy way?
  • On the Firebase side, is it better to filter before the FCM call (server-side check from Bubble) or after (send a silent data message and let the client decide whether to display it)? The latter avoids depending on potentially stale server state.
  • Looking ahead to iOS (APNs not yet set up on my side): I know APNs is more restrictive about silent / data-only notifications. Would you recommend committing to the “server-side filtering in Bubble” approach now to have a single iOS + Android logic, or is silent-push + client-side decision reliable enough on both platforms? Any pitfalls to anticipate when planning FCM → APNs?
  • Has anyone implemented this with FCM + Bubble cross-platform? Real-world feedback very welcome :folded_hands:

Thanks!