Workflow triggered app popup setup - beBit-tech/bebit-tech-android-app-sdk GitHub Wiki

This guide explains how to use the app push mechanism to trigger app popups based on incoming push notification data from Firebase. The mechanism involves evaluating notification data to determine whether to display the message or suppress it.

Workflow Overview

  1. Notifications are received from Firebase through the app push mechanism.
  2. If there's omnisegment_data in the incoming data, than using OmniSegment.handleNotification method and do not display the message.

Setup

To handle incoming push notifications and trigger app popups, integrate the following code into your FirebaseMessagingService.

public class MyFirebaseMessagingService extends FirebaseMessagingService {

  @Override
  public void onMessageReceived(RemoteMessage remoteMessage) {
        // Get the data payload
        Map<String, String> data = remoteMessage.getData();

        // Check if the data contains the "omnisegment_data" key
        if (data.containsKey("omnisegment_data")) {
            // Use OmniSegment to determine if the notification should be displayed
            OmniSegment.handleNotification(data);
            // Do not display the message
            return;
        }

    // ... rest of your implementation of displaying message